ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 9.00

create a program that will calculate the total weekly sales

Some of my information is not displaying correctly, can you look at my code and let me know what I am doing wrong. Below is the instructions. Sorry about yesterday.

 

In this project you will create a program that will calculate the total weekly sales for a company. You will be using two arrays to store the daily sales figures and the days of the week. Since you will be dealing with money you will need to use a double datatype. The program will prompt the user for the gross sales for each day of the week, Monday through Sunday. Here are some of the main variables you will need to create for the program:

  • dayWeek[7]                  Is a string array that holds the days of the week “Monday”, etc.
  • amountDailySales[7]   Is an array that holds the gross sales for each day
  • salesTax                         Default 9.75%, used to calculate the sales tax (use .0975)

Once you have gotten the daily sales numbers you will pass the dayWeek array to the following functions:

  • Function that will sort the array in ascending (lowest to highest) order 1, 2, 3, etc.
  • Function that will sum the daily sales and return the gross weekly sales
  • Function that will return the index (subscript) of the day with the highest sales amount
  • Function that will return the index (subscript) of the day with the lowest sales amount

You should display:

  • Total sales for the week
  • Total taxes withheld
  • Net profit
  • Day with the highest sales and the sales amount for that day
  • Day with the lowest sales and the sales amount for that day
  • Daily sales sorted from lowest to highest. Display the day and the amount

 

The formula for calculating the tax is:

Tax = Total Weekly Sales * Sales Tax

 

The formula for calculating the net profit is:

 Net Profit = Total Weekly Sales - Tax

 

Formatting the output: You will need to format all sales with a $ and 2 decimal points precision.

This project covers methods you have learned in chapters 2 through 8.

 

 

 

Program Output:

 

               This program calculates total weekly sales.

 

Please enter the gross sales received on Monday: $100.00

Please enter the gross sales received on Tuesday: $125.33

Please enter the gross sales received on Wednesday: $625.53

Please enter the gross sales received on Thursday: $813.55

Please enter the gross sales received on Friday: $2358.41

Please enter the gross sales received on Saturday: $1664.88

Please enter the gross sales received on Sunday: $189.56

 

 

Total sales for the week: $5877.26

Total taxes withheld: $573.03

Net profit: $5304.23

Day with the highest sales amount was Friday with a sales total of $2358.41

Day with the lowest sales amount was Monday with a sales total of $100.00

 

 

Sales sorted from lowest to highest:

Monday had gross sales of $100.00

Tuesday had gross sales of $125.33

Sunday had gross sales of $189.56

Wednesday had gross sales of $625.53

Thursday had gross sales of $813.55

Saturday had gross sales of $1664.88

Friday had gross sales of $2358.41

 

Press any key to continue . . .

 

Attachments:

Answers

(11)
Status NEW Posted 11 May 2017 03:05 AM My Price 9.00

-----------

Not Rated(0)