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

Instructions: Write a program for the sales manager at Computer Haven, a small b

ID: 3742095 • Letter: I

Question

Instructions: Write a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local companies. Figure 1 shows the charge for attending a seminar Notice that the charge per person depends on the number of people the company registers. For example, the cost for four registrants is $400; the cost for two registrants is $300. The program should allow the sales manager to enter the number of registrants for as many companies as needed. When the sales manager has finished entering the data, the program should calculate and display the total number of people registered, the total charge for those registrants, and the average charge per registrant. For example, if one company registers four people and another company registers two people, the total number of people registered is six, the total charge is S700, and the average charge per registrant is $116.67 150 100 90 10 or more Figure 1

Explanation / Answer

This is the program in C language:

#include<stdio.h>

#include<conio.h>

void main()

{

//program for sales manager at Computer Haven

printf("*******Welcome to Computer Haven******* ");
printf("Enter the Details required for Seminar Registration ");
printf("Number of company wants to register = ");
int i,j,a,b,c,sum=0,registrants=0,total_fee;


scanf("%d",&i);
for(j=1;j<=i;j++)
{
printf(" Enter the number of registrants for Company %d =",j);
scanf("%d",&a);
registrants=registrants+a;
if(a>=10)
{
b=90*a;
}
else if(a>=4 && a<10)
{
b=100*a;
}
else if(a<=3 && a>=1)
{
b=150*a;
}
sum=sum+b;
}
float avg= (float)sum/registrants;
printf(" Total number of people Registered = %d",registrants);
printf(" Total Registration Amount = %d",sum);
printf(" Average charge per Registrant = %f",avg);
getch();
}