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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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