Java: An Introduction to Problem Solving and Programming (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
8th Edition
ISBN: 9780134462035
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
Chapter 12, Problem 17E
Program Plan Intro

Revenue of Game Stadium

Program Plan:

  • Import required package.
  • Define “Main” class.
    • Define main function.
      • Create object “stadiumName” from “LinkedList” class.
      • Create object “gameRevenue” from “LinkedList” class.
      • Create object for scanner class.
      • Display prompt statement.
      • Assign “more_values” to “true”.
      • Performs “while” loop.
        • Read stadium name from user.
        • If stadium name is not equal to “done”, then set “more_values” to “false”.
        • Otherwise,
          • Read game revenue from user.
          • Add “st_name” to “stadiumName” by calling the method “addANodeToStart”.
          • Add “game_revenue” to “gameRevenue” by calling the method “addANodeToStart”.
      • Create array list for stadium names and game revenue.
      • Display prompt statement.
      • Read stadium name from user.
      • Set “total” to “0.0”.
      • Compute total amount of money for given stadium name.
        • If “name” is equal to “stadium_name”, then compute total revenue for given name.
      • Display total amount of money for given stadium name.

Blurred answer
Students have asked these similar questions
Write a program that uses an ArrayList of parameter type Contact to store a database of contacts. The Contact class should store the contact's first and last name, phone number, and email address. Add appropriate accessor and mutator methods. Your database program should present a menu that allows the user add a contact, display all contacts, search for a specific contact and display it, or search for a specific contact and give the user the option to delete it. The searches should find any contact where an instance variable contains a target search string. For example, if "elmore" is the search target then any contact where the first name, last name, phone number, or email address contains "elmore" should be returned for display or deletion. Use a "for each" loop to iterate through the ArrayList.
A Maze Room : In this lab, we will make a maze game. The maze is based on Linked Lists. Instead of having one possible direction (next), we will have 4 possible directions. Rooms: Use the below code as a basis to build your own room class.  Implement this class in the file room.py A room will be the basic object for our maze game. A room can have 4 doors (pertaining to north, south, east, and west).   Attached to each these directions we have either another room or None (we could also imagine that the None doors are just walls). We want the player to be able to tell what room they are in. Each room will have a unique description. When the player enters a room, the program will describe the room. This way the player will know if they went back to a room that have already been to. You MAY NOT change the method's arguments/names in ANY way. class Room():def __init__(self, descr):#Description of the room to print out#These should be unique so the player knows where they areself.descr =…
Consider records for patients at a medical facility. Each record contains an integer identification for a patient and strings for the date, the reason for the visit, and the treatment prescribed. Design and implement the class PatientRecord so that it overrides the method hashCode. Write a program that tests your new class. Design a class PatientDataBase that stores instances of PatientRecord, as described above. The class should provide at least three query operations, as follows. Given a patient identification and date, the first operation should return the reason for the visit, and the second operation should return the treatment. The third query operation should return a list of dates, given a patient identification.

Chapter 12 Solutions

Java: An Introduction to Problem Solving and Programming (8th Edition)

Ch. 12.1 - Prob. 12STQCh. 12.2 - Prob. 13STQCh. 12.2 - Prob. 14STQCh. 12.2 - Prob. 15STQCh. 12.2 - Prob. 16STQCh. 12.3 - Prob. 17STQCh. 12.3 - Prob. 18STQCh. 12.3 - Prob. 19STQCh. 12.3 - Write a definition of a method isEmpty for the...Ch. 12.3 - Prob. 21STQCh. 12.3 - Prob. 22STQCh. 12.3 - Prob. 23STQCh. 12.3 - Prob. 24STQCh. 12.3 - Redefine the method getDataAtCurrent in...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.4 - Revise the definition of the class ListNode in...Ch. 12.4 - Prob. 30STQCh. 12.5 - What is the purpose of the FXML file?Ch. 12.5 - Prob. 32STQCh. 12 - Repeat Exercise 2 in Chapter 7, but use an...Ch. 12 - Prob. 2ECh. 12 - Prob. 3ECh. 12 - Repeat Exercises 6 and 7 in Chapter 7, but use an...Ch. 12 - Write a static method removeDuplicates...Ch. 12 - Write a static method...Ch. 12 - Write a program that will read sentences from a...Ch. 12 - Repeat Exercise 12 in Chapter 7, but use an...Ch. 12 - Write a program that will read a text file that...Ch. 12 - Revise the class StringLinkedList in Listing 12.5...Ch. 12 - Prob. 12ECh. 12 - Write some code that will use an iterator to...Ch. 12 - Prob. 14ECh. 12 - Write some code that will use an iterator to...Ch. 12 - Prob. 17ECh. 12 - Revise the method selectionSort within the class...Ch. 12 - Repeat the previous practice program, but instead...Ch. 12 - Repeat Practice Program 1, but instead write a...Ch. 12 - Write a program that allows the user to enter an...Ch. 12 - Write a program that uses a HashMap to compute a...Ch. 12 - Write a program that creates Pet objects from data...Ch. 12 - Repeat the previous programming project, but sort...Ch. 12 - Repeat the previous programming project, but read...Ch. 12 - Prob. 9PPCh. 12 - Prob. 10PPCh. 12 - Prob. 11PPCh. 12 - Prob. 12PPCh. 12 - Prob. 13PPCh. 12 - Prob. 14PPCh. 12 - Prob. 15PP
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education