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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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
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
}
Transcribed Image 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
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.
Transcribed Image 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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY