#include #include #include using namespace std; int main() { constdouble MONSTERA_PRICE =11.50; constdouble PHILODENDRON_PRICE =13.75; constdouble HOYA_PRICE =10.99; constint MAX_POTS =20; constdouble POINTS_PER_DOLLAR =1.0/0.75; char plantType; int quantity; double totalAmount =0.0; int totalPoints =0; int availablePots =0; double plantPrice =0.0; cout << "Welcome to Tom's Plant Shop!" << endl; cout << "******************************" << endl; cout << "Enter your full name: "; string fullName; getline(cin, fullName);   output:  compiling code... Welcome to Tom's Plant Shop! ---------------------------------------- Enter your full name: ______ Available plants: M - Monstera ($ 11.5) P - Philodendron  ($13.75) H - Hoya ($10.99) Q - Quit shopping Enter the plant type (M/P/H/Q): ________     Part 1 Tom has recently started a plant-selling business, and he offers three different types of plants, namely Monstera, Philodendron, and Hoya. Each pot costs $11.50, $13.75, and $10.99, respectively, and there are 20 pots available for each plant. To minimize the workload of his employees, Tom requires a C++ program for online shopping. The program will exhibit a menu with all the available plant types. The customers can choose the plant type by entering the first letter of the plant's name (M or m for Monstera, P or p for Philodendron, and H or h for Hoya), followed by the quantity they want to buy. If the amount of pots requested exceeds the available pots, the program will display an apology message. The customers can select multiple plant types and quantities until they are ready to pay. Once they are done, the program will add a 12% tax to the total amount and display it with three decimal places. Finally, the program will print a thank you message. The program will not accept any invalid input. Sample Run 1 Welcome to Tom's Nursery Shop M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: M Enter how many pots would you like: 2   M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: P   Enter how many pots would you like: 2   M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: H   Enter how many pots would you like: 2   M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: a   Units/Description/cost 2 Monstera pots cost $23.000 2 Hoya pots cost $21.980 Total amount before tax is $44.980 Total amount with tax is $50.378   Thank you! Please come again!   Sample Run 2 Welcome to Tom's Nursery Shop M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: H     Enter how many pots would you like: 2 M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: H   Enter how many pots would you like: 3 M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: H   Enter how many pots would you like: 2 M or m for Monstera P or p for Philodendron H or h for Hoya A or a for payment Enter your choice: a   Units/Description/cost of Items 5 Hoya pots cost $54.950 Total amount before tax is $54.950 Total amount with tax is $61.544   Thank you! Please come again!   Part 2 Tom has grown his business and wants to express gratitude to his loyal customers by introducing a loyalty program. The program rewards customers 1 point for every 0.75 cents spent on repeat purchases. To determine a customer's points, the program will prompt the user to enter their full name and calculate their earned points based on their purchases. The program should print customer’s full name and the final points earned.   Part 3 To display the output in a clear manner, use manipulators to format the table. The table must contain the following details: -  Name of the customer -  Information about each plant purchased, along with the total cost -  Number of plant pots left in stock after the customer's purchase -  Total cost before and after taxes -  Points collected through the loyalty program.

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

 

 

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int main() {
constdouble MONSTERA_PRICE =11.50;
constdouble PHILODENDRON_PRICE =13.75;
constdouble HOYA_PRICE =10.99;
constint MAX_POTS =20;
constdouble POINTS_PER_DOLLAR =1.0/0.75;

char plantType;
int quantity;
double totalAmount =0.0;
int totalPoints =0;
int availablePots =0;
double plantPrice =0.0;

cout << "Welcome to Tom's Plant Shop!" << endl;
cout << "******************************" << endl;

cout << "Enter your full name: ";
string fullName;
getline(cin, fullName);

 

output: 

compiling code...

Welcome to Tom's Plant Shop!
----------------------------------------
Enter your full name: ______

Available plants:
M - Monstera ($ 11.5)
P - Philodendron  ($13.75)
H - Hoya ($10.99)
Q - Quit shopping
Enter the plant type (M/P/H/Q): ________

 

 

Part 1

Tom has recently started a plant-selling business, and he offers three different types of plants, namely Monstera, Philodendron, and Hoya. Each pot costs $11.50, $13.75, and $10.99, respectively, and there are 20 pots available for each plant. To minimize the workload of his employees, Tom requires a C++ program for online shopping. The program will exhibit a menu with all the available plant types. The customers can choose the plant type by entering the first letter of the plant's name (M or m for Monstera, P or p for Philodendron, and H or h for Hoya), followed by the quantity they want to buy. If the amount of pots requested exceeds the available pots, the program will display an apology message. The customers can select multiple plant types and quantities until they are ready to pay. Once they are done, the program will add a 12% tax to the total amount and display it with three decimal places. Finally, the program will print a thank you message. The program will not accept any invalid input.

Sample Run 1

Welcome to Tom's Nursery Shop

M or m for Monstera

P or p for Philodendron

H or h for Hoya

A or a for payment

Enter your choice: M

Enter how many pots would you like: 2
 
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: P
 
Enter how many pots would you like: 2
 
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: H
 
Enter how many pots would you like: 2
 
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: a
 
Units/Description/cost
2 Monstera pots cost $23.000
2 Hoya pots cost $21.980
Total amount before tax is $44.980
Total amount with tax is $50.378
 
Thank you! Please come again!
 

Sample Run 2

Welcome to Tom's Nursery Shop
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: H
 
 
Enter how many pots would you like: 2
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: H
 
Enter how many pots would you like: 3
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: H
 
Enter how many pots would you like: 2
M or m for Monstera
P or p for Philodendron
H or h for Hoya
A or a for payment
Enter your choice: a
 
Units/Description/cost of Items
5 Hoya pots cost $54.950
Total amount before tax is $54.950
Total amount with tax is $61.544
 
Thank you! Please come again!
 

Part 2

Tom has grown his business and wants to express gratitude to his loyal customers by introducing a loyalty program. The program rewards customers 1 point for every 0.75 cents spent on repeat purchases. To determine a customer's points, the program will prompt the user to enter their full name and calculate their earned points based on their purchases. The program should print customer’s full name and the final points earned.

 

Part 3

To display the output in a clear manner, use manipulators to format the table. The table must contain the following details:

  • -  Name of the customer

  • -  Information about each plant purchased, along with the total cost

  • -  Number of plant pots left in stock after the customer's purchase

  • -  Total cost before and after taxes

  • -  Points collected through the loyalty program.

 
Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
User Defined DataType
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