Create a program plan and then convert

Assignment Help Computer Engineering
Reference no: EM132178473

THE CODE IN C++. PLEASE SOLVE IT BEFORE 10 HOURS OF POSTING IT.

Program Purpose

Create a program plan and then convert it into C++ statements. Practice debugging, declaring variables, file I/O, functions, arrays, sorting and searching arrays.

Mandatory Instructions

This assignment will give you practice with functions and arrays covered in Chapter 6-8 of the Gaddis textbook.

Create a program that will read data from a file called prog1.txt. The data will consist of the product item name, quantity, location and price for products in an inventory. You do not know how many data items there will be in the file and should read the file until no more data is found.

Some strings will contain a space (use getline). All of the output for the program will go to the screen.

Have the main function call a function to input the data from the file prog1.txt and store the data in 4 arrays, item, qty, location and price.

The max number of elements should be set to 30. However, the input function will keeps track of the number of products and return that count to main().

The main() should:

1. Declare all arrays and variables needed

2. Call the ReadData Function to read the data and populate the arrays
a. Pass the arguments needed
b. Open the file prog1.txt inside this function.
c. Use a while loop to read data into the arrays until EOF is reached
d. close the file

3. Call the BSort Function to sort all four arrays from highest to lowest by quantity. (WORRY ABOUT THIS FUNCTION LAST, IN THE MEANTIME, USE A STUB) a. Use the bubble sort to sort all four arrays simultaneously using the qty array as they key.

4. Call the PrintArrays Function that prints the four arrays in tabular form with column headers a. Print the arrays in tubular form using the setw function

5. Call the Restock Function to print each product that is under stock. A product is under stock if it has fewer than 100 items in stock. Display the product item name and quantity in a tabular form. 6. Call the HiPrice Function to return the subscript of the highest price product in stock.

7. Call the AverWarehouse Function to return the average prices for each of the three warehouses. (see data). (Hint: You will need three sets of counters and accumulators. Lastly, the function will return all three averages via reference parameters.)

8. Add code in your main to display the item name, location and price of the highest price product in stock. (Output: The highest priced item is _____, located in ___________with a price of _______)

9. Add code in your main to display the average prices for all three warehouses.

Reference no: EM132178473

Questions Cloud

What is wardriving : Give a summary (of at least one-page) covering what networking technologies are involved in Wardriving and potential problems caused by Wardriving.
Describe your market share and profits : Describe your market share and profits, support with figures. Identify the market share in each round and describe the numbers, explain them
Sampling distribution of the sample mean : There might be several true statements. Each correct answer gives a mark. In you select an answer incorrectly, a mark will be subtracted.
Normal distribution with a standard deviation of 7 : It is known that tree heights follow a normal distribution with a standard deviation of 7.
Create a program plan and then convert : Create a program plan and then convert it into C++ statements. Practice debugging, declaring variables, file I/O, functions, arrays, sorting and searching array
Mean weight of chocolate per box : Using the data they collected, the family would like to test whether µ, the mean weight of chocolate per box, is less than their original signature box.
Write your own version of a class template : Write your own version of a class template that will create a dynamic stack of any data type.
What percentage of the test scores was at least 60 : a. What percentage of the test scores was at least 60? b. What percentage of the test scores was at most 89?
Describe the steps necessary to configure the servers : You want to form a PKI consisting of several CA servers that will deploy certificates to the users and computers.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Reverse the order of characters in a text file

Reverse the order of characters in a text file. For example, asdfghjkl becomes lkjhgfdsa.

  Explain in brief concept of domain and subdomain in chapel

Explain in brief the concept of domain and subdomain in Chapel, giving an example of each. Show how a domain can be used in loop control.

  How many bits are used to store each data type

What data types are supported? How many bits are used to store each data type? How is each data type represented internally?

  What is a ddos attack

What is a DDoS attack? In what two ways was the KrebsonSecurity.com DDoS attack unusual? What specific security weakness did the Mirai malware.

  Find the asymptotic efficiency of pans algorithm

Find the asymptotic efficiency of Pan's algorithm (you may ignore additions) and compare it with that of Strassen's algorithm. Assume T(1) = 1.

  What do these sources say about project management

What do these sources say about project management? Write a two-page summary of your findings. citing your references.

  Describe parallel architecture that uses pipeline processing

Describe a parallel architecture that uses pipeline processing. How does a shared-memory parallel configuration work?

  Discuss the nonverbal communication

Students are to observe two or more adults unknown to the observer. The student must not be able to hear the subjects being observed and those being observed.

  Convert these decimal numbers to 8-bit 2s complement binary

Convert these decimal numbers to 8-bit 2's complement binary numbers.

  Birt is an open source eclipse-based reporting system

BIRT is an open source Eclipse-based reporting system that integrates with your Java/J2EE application to produce compelling reports BIRT provides core reporting features as in report layout, data access and scripting.

  Write a short program to use the commands ldaa and staa

Show in your screenshots the machine language op-code and operand of these instructions and where in memory this is stored.

  Pick one of the products or services your company offers

pick one of the products or services your company offers or think of an idea to sell a product. then following the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd