Hello. I need your help because i\'m stuck. The question is: Your company is sel
ID: 3721094 • Letter: H
Question
Hello. I need your help because i'm stuck. The question is:
Your company is selling a new amazing product around the world. Now they want to make an analysis to see the result for each quarter (1/4 of a year). Your task is to design a simple program that calculates the sum for a specific quarter that the user enters. There are for the moment three traveling salesmen working at the company. You have been provided some data, see below;
#define NUMBER_OF_QUARTERS 4
#define NUMBER_OF_SALESMEN 3
int main(void) {
float Sales[NUMBER_OF_QUARTERS][NUMBER_OF_SALESMEN]=
{{3.3, 2.2, 7.1},
{4.0, 5.5, 3.1},
{6.9, 0.0, 3.5},
{2.2, 2.2, 1.2}};
Thank you!
Explanation / Answer
#include #define NUMBER_OF_QUARTERS 4 #define NUMBER_OF_SALESMEN 3 int main(void) { float Sales[NUMBER_OF_QUARTERS][NUMBER_OF_SALESMEN]= {{3.3, 2.2, 7.1}, {4.0, 5.5, 3.1}, {6.9, 0.0, 3.5}, {2.2, 2.2, 1.2}}; int num; printf("Enter quarter number: "); scanf("%d", &num); float total = 0; int i = 0, j = 0; for(i = 0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.