Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* File: inventory.cpp This program declares five vectors id, type, cost, price, and quantity, and passes them to two functions read() and write(). - The

/* File: inventory.cpp

This program declares five vectors id, type, cost, price, and quantity, and passes them to two functions read() and write().

- The read() function prompts the user repeatedly for data and reads them into vector elements. The program stops reading when an item number of `0' is entered.

- The write() function prints the vectors to the screen.

For example, the following transactions may take place:

Enter item number (0 to quit): 1 Enter the type ('a' = appliance or 'e' = electronic): a Enter the cost: 1500 Enter the price: 1750 Enter the number in stock: 45

Enter item number (0 to quit): 2 Enter the type ('a' = appliance or 'e' = electronic): z Enter the cost: 2799 Enter the price: 3000 Enter the number in stock: 130

Enter item number (0 to quit): 0

item number: 1 type : appliance cost : 1500.00 price : 1750.00 # in stock : 45

item number: 2 type : invalid type cost : 2799.00 price : 3000.00 # in stock : 130

*/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions

Question

How often do you meet with your graduate students?

Answered: 1 week ago