kazeroth123
Honorary Poster
- Joined
- Dec 2, 2017
- Posts
- 105
- Solutions
- 5
- Reaction
- 19
- Points
- 132
- Age
- 24
Create a Java program that accepts a Person's information.
Enter your first name: Christian
Enter your middle initial: L
Enter your last name: Bandoquillo
Enter your Birthdate: January 3, 1997
Enter the number of people in your household: 3
Enter your annual salary: 999,999.00
Enter your gender: Male
Enter your address: Davao City
Output
Welcome, Mr. Christian L Bandoquillo to our system. Your birthdate is January 3, 1997, and you are 24 years old, your gender is male and you reside in Davao City. The total number of people in your household is 3 and your annual salary is Php 999,999.00.
MY CODE:
import java.util.Scanner;
public class Activity2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your first name: ");
String inputFName = input.nextLine();
System.out.print("Enter your middle initial: ");
String inputMI = input.nextLine();
System.out.print("Enter your last name: ");
String inputLName = input.nextLine();
System.out.print("Enter your Birthdate: ");
String inputBDay = input.nextLine();
System.out.print("Enter the number of people in your household: ");
int inputPIYH = input.nextInt();
System.out.print("Enter your annual salary: ");
double inputASalary = input.nextDouble();
//Naskiskip po yung gender, ano po rason bakit ganon?
System.out.print("Enter your gender: ");
String inputGender = input.nextLine();
System.out.print("Enter your address: ");
String inputAddress = input.nextLine();
String FullName = inputFName + " " + inputMI + " " + inputLName;
// Code para mahanap yung age using birthday input
int Age = 21;
System.out.println("Welcome, "+FullName+" to our system. Your birthdate is "+inputBDay+", and you are "+Age+" years old, your gender is "+inputGender+" and you reside in "+inputAddress+". The total number of people in your household is "+inputPIYH+" and your annual salary is Php "+inputASalary+".");
}
}
Maraming Salamat po in advance kung sino man makatulong
Enter your first name: Christian
Enter your middle initial: L
Enter your last name: Bandoquillo
Enter your Birthdate: January 3, 1997
Enter the number of people in your household: 3
Enter your annual salary: 999,999.00
Enter your gender: Male
Enter your address: Davao City
Output
Welcome, Mr. Christian L Bandoquillo to our system. Your birthdate is January 3, 1997, and you are 24 years old, your gender is male and you reside in Davao City. The total number of people in your household is 3 and your annual salary is Php 999,999.00.
MY CODE:
import java.util.Scanner;
public class Activity2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your first name: ");
String inputFName = input.nextLine();
System.out.print("Enter your middle initial: ");
String inputMI = input.nextLine();
System.out.print("Enter your last name: ");
String inputLName = input.nextLine();
System.out.print("Enter your Birthdate: ");
String inputBDay = input.nextLine();
System.out.print("Enter the number of people in your household: ");
int inputPIYH = input.nextInt();
System.out.print("Enter your annual salary: ");
double inputASalary = input.nextDouble();
//Naskiskip po yung gender, ano po rason bakit ganon?
System.out.print("Enter your gender: ");
String inputGender = input.nextLine();
System.out.print("Enter your address: ");
String inputAddress = input.nextLine();
String FullName = inputFName + " " + inputMI + " " + inputLName;
// Code para mahanap yung age using birthday input
int Age = 21;
System.out.println("Welcome, "+FullName+" to our system. Your birthdate is "+inputBDay+", and you are "+Age+" years old, your gender is "+inputGender+" and you reside in "+inputAddress+". The total number of people in your household is "+inputPIYH+" and your annual salary is Php "+inputASalary+".");
}
}
Maraming Salamat po in advance kung sino man makatulong
Last edited: