import java.util.Scanner;
public class BSIT
{
public static void main(String[] args)
{
Scanner readme = new Scanner(System.in);
String name; // The user's name.
String email; // The user's email address.
double salary; // the user's yearly salary.
String favColor; // The user's favorite color.
System.out.println("Good Afternoon! This program will create");
System.out.println("your profile file, if you will just answer");
System.out.println("a few simple questions.");
/* Gather responses from the user. */
System.out.println("What is your first name? ");
name = readme.next();
System.out.println("What is your email address? ");
email = readme.next();
System.out.println("What is your yearly income? ");
salary = readme.nextDouble();
System.out.println("What is your favorite color? ");
favColor = readme.next();
/* Write the user's information */
System.out.println("Name: " + name);
System.out.println("Email: " + email);
System.out.println("Favorite Color: " + favColor);
System.out.println("Yearly Income:" + salary);
}
}
Monday, September 13, 2021
program that asks the user some questions and outputs the user's responses
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment