/* * Intro to Programming CSE 1310 * University of Texas at Arlington */ package tp28june2017; import java.util.Scanner; /** * * @author jcmtiernan */ public class TP28June2017 { /** * @param args the command line arguments */ public static void main(String[] args) { int camperAge; double camperTemperature; char letter; // float, long, short boolean married; String name, lastName, flag; String moreStdts = "y"; Scanner input = new Scanner(System.in); while(moreStdts.equalsIgnoreCase("y")) { System.out.println("Enter the student's first name: "); name = input.nextLine(); System.out.println("Enter student's last name: "); lastName = input.nextLine(); System.out.println("Enter the student's age: "); camperAge = input.nextInt(); System.out.println("Enter student's temperature: "); camperTemperature = input.nextDouble(); System.out.println("Is the student married?"); flag = input.next(); if (flag.equalsIgnoreCase("yes")) { married = true; } else if (flag.equalsIgnoreCase("y")) { married = true; } else if ((flag.equalsIgnoreCase("true")) || (flag.equalsIgnoreCase("t"))) { married = true; } else { married = false; } System.out.println("Student "+name +" "+lastName+" is age "+camperAge+ " and\n F temperature is "+camperTemperature+ " and camper is married? "+married); System.out.println("Are there more students to enter? Y/N "); moreStdts = input.nextLine(); } } }