Write a C++ program.  Name the file laundry.cpp You just purchased an existing laundromat. Create a program for patrons of the establishment. Notes: 1. Differenttypesofpatronsofthislaundromat: a. Discount members (indicated with an id between D100-D500) i. They can only use the Slow and Very Slow machines b. Regularmembers(indicatedwithanidbetweenD501-D900) i. They can only use the Slow and Fast Machines c. Elite members (indicated with an id between D901-D999) i. They can use any machine 2. Differenttypesofmachinesofthislaundromat: Fast (cost: 50 cents per use, needs 2 oz of detergent for each load) Slow(cost:35centsperuse,needs1.5ozofdetergentforeachload) Very Slow (cost: 25 cents per use, needs 1 oz of detergent for each load) Expected functionality: All registered users should be read in from a file (command line argument). The file should look like: Jon Doe,D160,3.75,5 //name, id, balance, amount of detergent in oz Jane Doe,D450,5.00,3 Thenumberofmachinesforeachtypeindicatedaboveshouldbereadinfromafile (command line argument). Include a sample file of how you chose to format the file. The user of the program should be able to type in an ID. Based on the ID, the menu should show the types of machines available (for example, a discount member can only use the Slow and Very Slow machines-they should not see the Fast Machines) along with availability of each. If there is no matching ID (meaning the user was not in the file), this should be indicated. Auserofamachineshouldbeabletochangethestatusofthemachinetoinuse(meaning they selected that machine for use). When a machine is not being used, it should be marked as available. Note that if a machine is in use, it should not be available for use to other users until the current user is done with it (see possible sample run). Once the user is done with a machine, it should be available for use once again. a. In order to use a machine, the user must have enough money and detergent. If they do not have enough, they should have the option to add more money or detergent. Ausershouldhavetheoptiontopickuplaundrywhenfinished(meaningthemachinewill become available once again). There should be an option for a receipt (in the form of a file). The receipt should include the name, machine used, current balance and detergent. Theprogramshouldexitwhentheuserexits. Notes: You should make a Laundromat class, a Person class and a Machine class. ( USE MORE THESE THREE CLASSES). Use inheritance and polymorphism as necessary.) Possible sample run: WELCOME! Laundromat info read in: //should be a command line argument ***AVAILABLE*** Fast Machines: 3 Slow Machines: 0 Very Slow Machines: 2 All Registered Users info read in. //should be a command line argument ~Please enter your ID: D150 ~Welcome discount member. 1) Start a laundry load 2) Finish a laundry load //user finishes with a machine start ***AVAILABLE*** Slow Machines: 0 Very Slow Machines: 2 ~Which machine would you like to use? Slow ~Sorry, we do not have any slow machines currently available. Enter again. Very Slow ~Ok, using 25 cents and putting 1 oz of detergent. ~Loading machine... ~You currently have: 75 cents left and 5 oz of detergent left. ------------- ~Please enter your ID: D345 Sorry, we do not have this ID registered. //wasn’t in the Registered Users file ------------- ~Please enter your ID: D990 ~Welcome elite member. 1) Start a laundry load 2) Finish a laundry load start ***AVAILABLE*** Fast Machines: 3 Slow Machines: 0 Very Slow Machines: 1 //Notice it is one less because one is currently in use from the previous member ~Which machine would you like to use? fast ~Sorry, you do not have enough money on your account for this. You need 50 cents and you only have 20 cents. ~Would you like to add money to your account? Yes ~How much? 50 cents ~Loading machine... ~You currently have: 20 cents left and 2 oz of detergent left. ------------- ~Please enter your ID: D150 ~Welcome discount member. ~You currently have one laundry load. Would you like to pick up? Yes //free up a machine ~Would you like a receipt? Yes ~Printing out... //text file should be output ~Thank you for your business. ------------- ~Please enter your ID: exit

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 Write a C++ program.  Name the file laundry.cpp

You just purchased an existing laundromat. Create a program for patrons of the establishment.

Notes:

1. Differenttypesofpatronsofthislaundromat:
a. Discount members (indicated with an id between D100-D500)

i. They can only use the Slow and Very Slow machines
b. Regularmembers(indicatedwithanidbetweenD501-D900)

i. They can only use the Slow and Fast Machines
c. Elite members (indicated with an id between D901-D999)

i. They can use any machine

2. Differenttypesofmachinesofthislaundromat:

  1. Fast (cost: 50 cents per use, needs 2 oz of detergent for each load)

  2. Slow(cost:35centsperuse,needs1.5ozofdetergentforeachload)

  3. Very Slow (cost: 25 cents per use, needs 1 oz of detergent for each load)

Expected functionality:

  1. All registered users should be read in from a file (command line argument). The file should look like:

    Jon Doe,D160,3.75,5 //name, id, balance, amount of detergent in oz Jane Doe,D450,5.00,3

  2. Thenumberofmachinesforeachtypeindicatedaboveshouldbereadinfromafile (command line argument). Include a sample file of how you chose to format the file.

  3. The user of the program should be able to type in an ID. Based on the ID, the menu should show the types of machines available (for example, a discount member can only use the Slow and Very Slow machines-they should not see the Fast Machines) along with availability of each. If there is no matching ID (meaning the user was not in the file), this should be indicated.

  4. Auserofamachineshouldbeabletochangethestatusofthemachinetoinuse(meaning they selected that machine for use). When a machine is not being used, it should be marked as available. Note that if a machine is in use, it should not be available for use to other users until the current user is done with it (see possible sample run). Once the user is done with a machine, it should be available for use once again.

    a. In order to use a machine, the user must have enough money and detergent. If they do not have enough, they should have the option to add more money or detergent.

  5. Ausershouldhavetheoptiontopickuplaundrywhenfinished(meaningthemachinewill become available once again). There should be an option for a receipt (in the form of a file). The receipt should include the name, machine used, current balance and detergent.

  6. Theprogramshouldexitwhentheuserexits.

Notes:
You should make a Laundromat class, a Person class and a Machine class. ( USE MORE THESE THREE CLASSES). Use inheritance and polymorphism as necessary.)

Possible sample run:

WELCOME!
Laundromat info read in: //should be a command line argument

***AVAILABLE*** Fast Machines: 3
Slow Machines: 0
Very Slow Machines: 2

All Registered Users info read in. //should be a command line argument

~Please enter your ID: D150

~Welcome discount member.
1) Start a laundry load
2) Finish a laundry load //user finishes with a machine

start

***AVAILABLE*** Slow Machines: 0
Very Slow Machines: 2

~Which machine would you like to use?
Slow
~Sorry, we do not have any slow machines currently available. Enter again. Very Slow
~Ok, using 25 cents and putting 1 oz of detergent.

~Loading machine...
~You currently have: 75 cents left and 5 oz of detergent left. -------------
~Please enter your ID:
D345

Sorry, we do not have this ID registered. //wasn’t in the Registered Users file -------------
~Please enter your ID:
D990

~Welcome elite member. 1) Start a laundry load 2) Finish a laundry load

start

***AVAILABLE***
Fast Machines: 3
Slow Machines: 0
Very Slow Machines: 1 //Notice it is one less because one is currently in use from the previous member

~Which machine would you like to use?
fast
~Sorry, you do not have enough money on your account for this. You need 50 cents and you only have 20 cents.
~Would you like to add money to your account?

Yes
~How much?
50 cents
~Loading machine...
~You currently have: 20 cents left and 2 oz of detergent left. -------------
~Please enter your ID:
D150

~Welcome discount member.
~You currently have one laundry load. Would you like to pick up? Yes //free up a machine
~Would you like a receipt?
Yes
~Printing out... //text file should be output
~Thank you for your business.
-------------
~Please enter your ID:
exit

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education