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

Programming in C# Write an application that displays revenue generated for exerc

ID: 3776756 • Letter: P

Question

Programming in C#

Write an application that displays revenue generated for exercise classes at the Tappan Gym. The gym offers two types of exercise classes, zumba and spinning, six days per week, four times per day. Zumba is offered at 1, 3, 5, and 7 p.m.; spinning is offered at 2, 4, 6, and 8 p.m. When attendees sign up, they agree to pay $4.00 per class for zumba and $5.00 for spinning. Produce a table displaying the number of attendees per time slot. Display a row and column of totals showing the total number of attendees by day and also time period. Also include a column showing the revenue generated each day and the overall revenue per type of exercise. Do a compile-time initialization of your data structures using data from the following table.

Monday Tuesday Wednesday Thursday Friday Saturday 1:00 12 11 12 12 Zumba 3:00 10 13 10 14 10 10 5:00 17 17 22 17 21 7:00 22 22 22 22 12 10

Explanation / Answer

#include <stdio.h>
#include <conio.h>

int main() {
int i,j,k,total;
int zumba[6][4] = {          {12,10,17,22},
     {11,13,17,22},
     {12,10,22,22},
     {9,14,17,22},
     {12,10,21,12},
     {12,10,5,10}
                           };

int spinning[6][4] = {     {7,11,15,8},
      {9,9,9,9},
      {3,12,13,7},
      {2,9,9,10},
      {8,4,9,4},
                  {4,5,9,3}
                              };
clrscr();


/* Display the Zumba table */

printf("                    Zumba                                       ");
printf("     1:00 3:00 5:00 7:00 Revenue ");

for(i=0;i<6;i++)
{

if ( i == 0)
printf("Monday ");

else if (i == 1)
printf("Tuesday   ");

else if (i == 2)
printf("Wednesday ");

else if (i == 3)
printf("Thursday ");

else if (i == 4)
printf("Friday ");

else
printf("Saturday ");

total = 0;
for(j=0;j<4;j++)
{
    printf(" %d ",zumba[i][j]);
    total = total + zumba[i][j];
}
total = total * 4;
printf(" %d ",total);
printf(" ");
}                    

printf(" ");


/* Display the Spinning table */
printf("                    Spinning                                      ");
printf("     2:00 4:00 6:00 8:00 ");

for(i=0;i<6;i++)
{

if ( i == 0)
printf("Monday ");

else if (i == 1)
printf("Tuesday   ");

else if (i == 2)
printf("Wednesday ");

else if (i == 3)
printf("Thursday ");

else if (i == 4)
printf("Friday ");

else
printf("Saturday ");

total = 0;
for(j=0;j<4;j++)
{
    printf(" %d ",spinning[i][j]);
    total = total + spinning[i][j];
}
total = total * 5;
printf(" %d ",total);
printf(" ");
}


/* Total Revenue generate by Zumba activity */

printf(" ");
total=0;
for(i=0;i<6;i++)
{
for(j=0;j<4;j++)
{
    total = total + zumba[i][j];
}
}
total=total * 4;
printf("Total Revenue generate by Zumba activity is : %d ",total);

/* Total Revenue generate by Spinning activity */

total=0;
for(i=0;i<6;i++)
{
for(j=0;j<4;j++)
{
    total = total + spinning[i][j];
}
}
total=total * 5;
printf("Total Revenue generate by Spinning activity is : %d",total);

getch();
return 0;
}