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.
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.
|