Plastic Products Inc. buys several types of recycled plastic. You have been asked to create a C++ console application to produce a purchase order. The application displays different types of recycled...


Plastic Products Inc. buys several types of recycled plastic. You have been asked to create a C++ console application to produce a purchase order. The application displays different types of recycled plastic and asks the user for the number of pounds required for each one. After collecting the data, display each plastic type, the number of pounds, price per pound, total dollar amount for each plastic type. Also display the total weight and total cost of the purchase.



Requirements:



  • Create four parallel arrays.

    • One array initialized with the names of each plastic type (table below)

    • One array initialized with the price of each plastic type per pound (table below). The prices are in cents. You must use them as dollar amounts in the array.

    • One array to hold the number of pounds for each plastic type

    • One array to store the total cost for each plastic type



  • Store values in these arrays. Print the values stored in the arrays.

  • Absolutely, positively,NO globalvariables!

  • All four arrays are created in the main function.

  • Error checking:

    • Do not accept negative values from the user.

    • Keep asking the user to input correct values until they enter invalid values.



  • Format your output using setw() and setprecision() to display two decimals. You must use one setw() and left or right manipulators for each variable you are printing. That means you will have more than one setw() for eachcout. Use trial and error to find the best display. See the output example.

  • Apply all general requirements specified in previous labs.

  • You can decide whether or not to use functions.

  • Use the following table for material names and prices.


  • In all cases, you must treat arrays like aggregate data types (in loops), not a bunch of individual variables. You must demonstrate you understand why and how arrays are used.

Plastic Cost































Recycled Material Type

Price/Pound
(Cents)

PET beverage bottles and jars

8

Natural high-density polyethylene

34

Color HDPE

4

Grade A film

8

Grade B film

5

Grade C film

2


Jan 31, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here