PLEASE ANSWER IN C++

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

PLEASE ANSWER IN C++

Post by answerhappygod »

PLEASE ANSWER IN C++
Please Answer In C 1
Please Answer In C 1 (70.29 KiB) Viewed 18 times
7.21 LAB*: Program: Online shopping cart (Part 1) (1) Create three files to submit: • Item ToPurchase.h - Class declaration • Item To Purchase.cpp - Class definition • main.cpp - main() function Build the Item ToPurchase class with the following specifications: • Default constructor • Public class functions (mutators & accessors) • SetName() & GetName() (2 pts) o SetPrice() & GetPrice() (2 pts) o SetQuantity() & GetQuantity0) (2 pts) Ex: • Private data members o string itemName - Initialized in default constructor to "none" o int itemPrice - Initialized in default constructor to 0 oint itemQuantity - Initialized in default constructor to 0 (2) In main(), prompt the user for two items and create two objects of the Item ToPurchase class. Before prompting for the second item, call cin.ignore() to allow the user to input a new string. (2 pts)
Ex: Item 1 Enter the item name: Chocolate Chips Enter the item price: 3 Enter the item quantity: 1 Item 2 Enter the item name: Bottled Water Enter the item price: 1 Enter the item quantity: 10 (3) Add the costs of the two items together and output the total cost. (2 pts) Ex: TOTAL COST Chocolate Chips 1 @ $3 = $3 Bottled Water 10 @ $1 = $10 Total: $13
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply