Determine the highest sales in the report

Assignment Help C/C++ Programming
Reference no: EM132101196

PLEASE WRITE IN C++

Write a program that reads sales data from a file. The program outputs the totals sales, average sales, lowest and highest sales.

Outcomes:

1. Read data from a file into an array.

2. Process data in a partially filled array via functions.

3. Pass an array as a parameter to a function.

4. Use for and while loops when processing an array.

Specifications:

1. Use an array to store the sales data. Sales data should be stored as a double.

2. The company has at most 20 locations. (Max capacity of the array)

3. The input file contains a sales report that list the number of stores reporting data and the sales data.

4. Sample Input file format: (samplefile1 and samplefile2)

3

27648.92 234.83 23458.32

The '3' means that this file contains data for three locations. The numbers represent the sales for each location.

5. The main function should be modular so the main tasks must be handled by functions. Note: this is only an outline of the function requirements. You will need to decide on function names, parameter lists and return types on your own.

6. The tasks are:

a. Ask the user for the file name that contains the sales data. Fill the array with the sales data from a file.

b. Total the sales data.

c. Average the sales data.

d. Determine the highest sales in the report.

e. Determine the lowest sales from the report

7. The main function should output the data to the user.

8. Add code to the main function to allow the user to rerun the program.

9. Sample output:

Enter file name: sales.dat

The total sales are $755260.00

The average sales amount is $ 75526.00

The highest sales amount is $124569.00

The lowest sales amount is $ 35678.00

10. Extra Credit - Write two additional functions:

a. Write a function that sorts the arrays sales data in ascending order. You may not use selection sort. Bubble sort example.

b. Write a function that displays all the elements of the array in a nicely formatted output.

Reference no: EM132101196

Questions Cloud

In each of the last five decades i business ethics : In each of the last five decades i business ethics, which decade saw the most development in business ethics?
What is the amount of cash receipts from customers : Sales revenue was $1,095,307,000 for the year. What is the amount of cash receipts from customers?
How do you think so many social media platforms : How do you think so many social media platforms/messages are able to get away with deceptive advertisement? What are some examples??
Write a program that will use a recursive binary search : Write a program that will use a recursive binary search to locate an integer in a sorted array. The integer values will be provided in a file named dataarray.
Determine the highest sales in the report : Write a function that sorts the arrays sales data in ascending order. You may not use selection sort. Bubble sort example.
Write a program to calculate how many squares are required : There is an old story that the emperor wanted to thank the inventor of the game of chess and asked the inventor to name his reward.
Write a program that initially prompts the user for a file : Write a program that initially prompts the user for a file name. If the file is not found, an error message is output, and the program terminates.
Write a program calendar c that takes two inputs : Write a program calendar.c that takes two inputs: the start day of a month [Sunday is 0, Monday is 1,....., Saturday is 6] and the number of days in a month.
Create an array that holds random integers : Create an array that holds 1000 random integers between 1-1000. Please write a short paragraph, bullet points.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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