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

  Where are the inputs and outputs of the decoder connected

How many address and data lines are required for a 1M × 16 memory chip?What is the size of a decoder with one chip enable (CE?) to obtain a 64K × 32 memory.

  Write up a description of your model

Write up a description of your model, the list of items you have chosen to implement, and the outcome of the quota.

  How long does it take to move the message from a to b

Consider a message that is 1000 byte long that is to be sent from A to B. How long does it take to move the message from A to B as a single packet?

  Produce a simple command processor

Now that the OS has a keyboard driver, it is possible to produce a simple command processor. You should expand the Run() method in command.c to produce a simple command processor that implements the following commands: cls- Clear the screen

  Create a rfp that will minimize procurement related risks

Create a 2- to 3-page Request for Proposal (RFP) that will minimize procurement related risks for this project. The RFP should contain the following components.

  What is the total running time of counting

What is the total running time of counting from 1 to n in binary if the time needed to add 1 to the current number i is proportional.

  Display the last ten entries of the history list in bash

Display the last 10 entries of the history list in bash, tcsh and ksh. Show how you would execute event number 62, but with "ls -al" in tcsh and in ksh.

  Explain the two ways to register a jdbc driver

Explain the two ways to register a JDBC driver. What purpose does a Statement object serve when SQL is used through JDBC?

  Analyze security requirements and develop a security policy

analyze security requirements and develop a security policy that fully addresses them. the project will enable the

  Create your own unique database table using mysql

create your own unique Database table using MySQL, Query the table to display all columns for all records

  Write a loop to keep track of the position of the particle

Simulate Brownian Motion (is the random number of motion particles suspended in liquid or gas resulting from their collision with the atoms)

  Implement the tree-based union-find partition data structure

Implement the tree-based union/find partition data structure with both the union-by-size and path-compression heuristics.

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