Question

In: Computer Science

C PROGRAM Problem Specification: You are a software engineer of a Car Sale company. And Car...

C PROGRAM

Problem Specification:

You are a software engineer of a Car Sale company. And Car Sales is preparing for the end of the year sale. CEO wants to track the sales of your four sales people. You have been asked to help with the preparations for the sales event.

The CEO asked for a program to quickly tabulate their sale. It will be your job to implement this program in C. You are not required to use functions in this lab. Your program will need to perform the following tasks to receive full credit for this assignment:

Read a list of final sales of each sales person into a one-dimensional array.

  • Calculate the percentage of each sales person of the total sales.
  • Print each individual sales percentage.
  • Print the total sales
  • The array will be of type double.
  • Sales will be printed 2 decimal places and the percentage listed with 1 decimal place showing.

Testing:

Try this set of sales, for your test run. $182,550.92        $239,557.34      $98,278.88        $ 411,642.47

Input:

Enter the sales for Sales Person 1: 182550.92

Enter the sales for Sales Person 2: 239557.34

Enter the sales for Sales Person 3: 98278.88

Enter the sales for Sales Person 4: 411642.47

Output:

Sales Person Percentage of Sale

Sales Person 1: 19.6%

Sales Person 2: 25.7%

Sales Person 3: 10.5%

Sales Person 4: 44.2%

Total Sales for Event: $932029.61

Solutions

Expert Solution


#include <stdio.h>


int main()
{
double sales[10];
int n;
printf("Enter number of sales people: ");
scanf("%d",&n);
double sum=0;
for(int i=0;i<n;i++){
   printf("Enter the sales for Sales Person %d:",i+1);
   scanf("%lf",&sales[i]);
   sum=sum+sales[i];
}
printf("Sales Person Percentage of Sale\n");
for(int i=0;i<n;i++){
   printf("Sales Person %d: %.1lf %\n",i+1,sales[i]/sum*100);
}
printf("Total Sales for Event: $%.2lf",sum);

return 0;
}

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me


Related Solutions

Write a C program of car sale: The Visual Studio project itself must make its output...
Write a C program of car sale: The Visual Studio project itself must make its output to the Console (i.e. the Command Prompt using printf) and it must exhibit the following features as a minimum: 10%: Looping Menu with 2 main actions: Sell Car, View Sales Note: A Car is defined only by its price 10% Must contain at least one array containing sales figures (each entry represents the price of one vehicle) for a maximum of 10 Cars 5%:...
Subject : Professional ethics in computing Software Engineer Christopher is hired by software company, ABC Software,...
Subject : Professional ethics in computing Software Engineer Christopher is hired by software company, ABC Software, and involved in the design of specialized software for Gladstone City Council (GCC) in connection with the operations of facilities that impact on public health and safety, such as those that control air and water quality. Testing the software system is part of the design process. Christopher conducts extensive testing and finds that the software is safe to use under existing standards. But Christopher...
I need to write a program in C with the following specification * ​​​​​​​Line one of...
I need to write a program in C with the following specification * ​​​​​​​Line one of the standard input will have the total number of people which must not be greater than 10 * Each of the subsequent lines of input will be the first name of a person and their number (ex. "Adam 85") one space between name and number * Each name must be a maximum of 14 characters * Put the first names into an array called...
9.7. You are auditing a company engaged in the development and sale of games software over...
9.7. You are auditing a company engaged in the development and sale of games software over the internet. Software is high quality and therefore we point our attention to controls over the sales of their products. The companies systems are fully integrated and sales automatically update the corresponding bank and trade receivable records (depending on payment type) and quantity inventory records. Your firm asks audit staff to classify control risk as low, medium or high. Initial discussions with management have...
1. Specification Write a C program to implement a simple calculator that accepts input in the...
1. Specification Write a C program to implement a simple calculator that accepts input in the following format and displays the result of the computation: calc [operand_1] [operator] [operand_2] The operands operand_1 and operand_2 are non-negative integers. The operator is one of the following: addition (+), subtraction (-), multiplication (x), division (/) and modulo (%). Note: For the multiplication operator, use letter ‘x’. If you use the asterisk ‘*’, your program will not work properly 2. Implementation • The program...
You are a software engineer and project manager, a customer approaches you and wishes you to...
You are a software engineer and project manager, a customer approaches you and wishes you to develop a software product for them Some details The interview process went well with the customer, except there was limited detail, and you are not sure if the customer has sufficient detail. Your engineering group mostly young, freshly out of college, there are few older seasoned engineers that have done large projects before You have a 1 year time limit Your management believes in...
Mindy Lee was a software engineer who worked for a company that is known for its...
Mindy Lee was a software engineer who worked for a company that is known for its inventory management software suite. She specialized in designing interfaces that help a business migrate its inventory data to cloud computing. Mindy has loved the Internet since her school years; she used email and browsers before any other kid in her class. She books all her travel arrangements online, including flights, car rentals and hotel rooms. Mindy has inherited money and invested in a small...
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
In a recent advertisement a new car has a sale price of $32,000. The car company...
In a recent advertisement a new car has a sale price of $32,000. The car company is giving you the option of receiving a $3500 cash rebate or a special interest rate (for those who qualify) at 0.9% for 5 years. If the local bank will lend you the money at 4.5% for 5 years should you take the discount and borrow from the bank or select the low interest rate from the company? What option would you select and...
Program this in C thank you PROBLEM DESCRIPTION: Write a program to implement the following requirement:...
Program this in C thank you PROBLEM DESCRIPTION: Write a program to implement the following requirement: The program will read from standard input two things - a string str1 on the first line of stdin (this string may be an empty string) - a string str2 on the second line of stdin (this string may be an empty string) Note that stdin does not end with '\n'. The program will output a string that is the concatenation of string str1...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT