Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Ion Reality Sales Corporation would like to have an application showing how

ID: 3854458 • Letter: T

Question

The Ion Reality Sales Corporation would like to have an application showing how each monthly sales contributes to their overall total sales. Write a program that accepts as input any number of monthly sales amounts. After all values have been entered, display a report showing each of the monthly sales amounts and the percentage contribution of the individual monthly sales figure to the overall total sales. Your report should show each original value entered and the percentage that value contributes to the total. You may prompt the user for the number of values to be inputted. Be sure your design is aesthetically pleasing with the percentage rounded to one position and all values number aligned

1)Let the user to enter monthly sales amount, and store the inputs into an array.

2)Calculate the total sales amount.

3)Calculate the percentage contribution for each month.

4) Display the results.  

C# visual 2010

Explanation / Answer

#include<stdio.h>

int main()

{

int total_sales = 0,arr[12],i,temp;

printf("enter the amount of sales for 12 months ");

for(i=0 ; i<12 ; i++)

{

scanf("%d",&temp);

arr[i] = temp;

total_sales = total_sales + arr[i] ;

}

printf("total sales are ====> %d ",total_sales) ;

for(i=0 ; i<12 ; i++)

{

printf("sale percentage 0f month %d is ====> %d% ",i+1,(arr[i]*100/total_sales));

}

return 0;

}

sample Output :

enter the amount of sales for 12 months

10 20 30 40 50 60 70 80 90 100 110 120

total sales are ====> 780

sale percentage 0f month 1 is ====> 1%

sale percentage 0f month 2 is ====> 2%

sale percentage 0f month 3 is ====> 3%

sale percentage 0f month 4 is ====> 5%

sale percentage 0f month 5 is ====> 6%

sale percentage 0f month 6 is ====> 7%

sale percentage 0f month 7 is ====> 8%

sale percentage 0f month 8 is ====> 10%

sale percentage 0f month 9 is ====> 11%

sale percentage 0f month 10 is ====> 12%

sale percentage 0f month 11 is ====> 14%

sale percentage 0f month 12 is ====> 15%

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote