Write a JAVA procedural program that gives information about tourist attractions. The user should first input how many tourist attractions they wish to ask about and then be allowed to name that many...


Write a JAVA procedural program that gives information about tourist attractions.
The user should first input how many tourist attractions they wish to ask about and then be allowed
to name that many places. The program should give their opening time (assumed on the hour and in
the morning for the purposes of this exercise) and whether they open on bank holidays. A new type
called Attraction must be created (a record type) and each separate piece of information about an
attraction should be stored in a separate field of the record (its name - a String, opening time - an
integer, closing time - an integer, and whether they open on bank holidays -a boolean).
A separate method must be written that given a String (an attraction name) as argument returns a
String containing the correct information about the attraction to print. The String should then be
printed by the calling method. An example run of the program (bold words are typed by the user):
Your answer need only include the information about known stations as in this example.



  • EXPLAIN HOW YOUR PROGRAM WORKS

  • Write a program using counter controlled FOR loop statements.

  • Write a program that creates user-defined types, defining and using records.

  • Write a program that has at least one method that take argument(s) and returns a result

  • Write a program that includes useful comments, at least one per method saying what it does.

  • Write a program that uses indentation in a way that makes its structure clear.

  • Write a program that uses variable names that give an indication of their use.

  • Provide commenrted code with explanation in every step



The first image is an example run of the program. The second is an image of the template you should follow when creating the program.


import java.util.Scanner; // Needed to make Scanner available<br>class name // change the name to something appropriate<br>{<br>public static void main (String [] a)<br>{<br>method_call ); //Change this to a call to the method doing the work<br>System.exit(0);<br>}<br>// Add all methods the program uses here<br>}<br>

Extracted text: import java.util.Scanner; // Needed to make Scanner available class name // change the name to something appropriate { public static void main (String [] a) { method_call ); //Change this to a call to the method doing the work System.exit(0); } // Add all methods the program uses here }
How many attractions do you need to know about? 4<br>Name attraction 1? The Eden Project<br>The Eden Project opens on bank holidays.<br>It opens at 9am.<br>Name attraction 2? Tate Modern<br>Tate Modern does not open on bank holidays.<br>It opens at 10am.<br>Name attraction 3? The Zoo<br>I have no information about that attraction.<br>Name attraction 4? London Zoo<br>London Zoo opens on bank holidays.<br>It opens at 10am.<br>

Extracted text: How many attractions do you need to know about? 4 Name attraction 1? The Eden Project The Eden Project opens on bank holidays. It opens at 9am. Name attraction 2? Tate Modern Tate Modern does not open on bank holidays. It opens at 10am. Name attraction 3? The Zoo I have no information about that attraction. Name attraction 4? London Zoo London Zoo opens on bank holidays. It opens at 10am.
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here