Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program we want to print out a report showing an inventory item's code, name, price, quantity, and total value. The code used should

In this program we want to print out a report showing an inventory item's code, name, price, quantity, and total value.

  • The code used should be randomly selected from one of the following four: 010100ABC, A1B2C3D4, EFG123-2907, ALPHA2398.
  • The name used should be chosen from one of the following six: Soap, Hammer, Penny Nail, Refrigerator, Oven, Generator.
  • The quantity should be a random number from 1 to 100,000.
  • The price should be from 10.00 to 1000.00
  • The total value should be computed by multiplying the quantity by the price

The output should be in the following format

on one line display

  • the heading: "Item Code" left-justified in 15 spaces, followed by
  • the heading: "Item Name" left-justified in 20 spaces, followed by
  • the heading: "Qty" right-justified in 7 spaces, followed by
  • the heading: "Price" right-justified in 8 spaces, followed by
  • the heading: "Total Value" right-justified in 15 spaces

on the next line display

  • the code left-justified in 15 spaces, followed by
  • the name left-justified in 20 spaces, followed by
  • the quantity right-justified in 7 spaces, followed by
  • the price right-justified in 8 spaces with 2 digits to the right of the decimal, followed by
  • the total value right-justified in 15 spaces with 2 digits to the right of the decimal

An Example of the output might be:

Item Code Item Name Qty Price Total Value EFG123-2907 Generator 75 110.00 8250.00

(Note: the actual spacing of the output may differ from the example because of font issues)

Be sure to include comments in a format similar to what has been required in class and on the exercises, which will include your name as the author and the date you completed the code. Submit your final, error-free source file (the .cpp file).

Note that code that does not compile will not be graded.

If your final program does not satisfy all requirements, you should note in your comments at the top of the program any deviations from the requirements. Doing so will allow you to recover up to half the points you would otherwise lose for non-compliance.

PreviousNext

The subject is C++

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago

Question

When there was controversy, was it clear who had the final say?

Answered: 1 week ago