Starting from:

$30

Lab #3 Switch statements and loops Solution

Lab Description




In this lab you will create a Java file, MyJavaLab03.java and complete the three outlined objectives below.







Objective 1




Print your name and student ID to the screen, in the format: YourLastName, YourFirstName, YourStudentID




Objective 2




In the main method, prompt the user asking them which country they want to learn more about. Keep prompting the user until they type in the word "quit".

Note: orange text is what you print, blue text is the text the user typed in.







Example use of the program:

Type quit to exit program.

Which country would you like to learn more about: Australia, France, Mexico, Nigeria, Philippines, USA Nigeria

Nigeria is the seventh most populated country in the world.







Type quit to exit program.

Which country would you like to learn more about: Australia, France, Mexico, Nigeria, Philippines, USA Philippines

Philippines has approximately 7500 islands, with only about 2000 of them inhabited.







Type quit to exit program.

Which country would you like to learn more about: Australia, France, Mexico, Nigeria, Philippines, USA quit







Have a great day!







When determining what fact to display, use a switch statement (not an if/else if statement).







Note: the questions should be phrased exactly as they appear above. The country to unique fact table is listed here:







Country



Unique Fact



Australia



There are three times as many sheep than people living in Australia.



France



France is the world's most popular tourist destination (approximately 83.7 million visitors arrived in France in 2014).



Mexico



The first printing press in North America was used in Mexico City in 1539.



Nigeria



Nigeria is the seventh most populated country in the world.



Philippines



Philippines has approximately 7500 islands, with only about 2000 of them inhabited.



USA



Americans eat about 100 acres of pizza each day, with about 3 billion pizzas sold annually in the USA.









What do you have to turn in?




A Java file named MyJavaLab03.java inside a zip folder named LastNameFirstName-lab03.zip







Criteria for grading:




● [15 pts] Your lab is submitted according to specifications (proper name of file, proper format)

● [15 pts] Well commented code explaining what you are doing (clear and grammatically correct)

● [10 pts] Objective 1

● [60 pts] Objective 2










Bonus points




● [5 pts] Ignore upper / lower casing (valid input examples: Usa, MeXico, QUIT, etc.)

More products