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.
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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images