Answer to Question #283568 in C++ for Kristen

Question #283568

Modify the program above so that it displays the message<<<no credits beyond 100>>> if the credit entered is beyond 100

1
Expert's answer
2021-12-30T01:37:11-0500
#include<stdio.h>
#include<conio.h>

void main ()
{
	float m1,m2,m3;
	float per,avg;
	float total;

	printf(" enter the marks of m1 ");
	scanf("%f", &m1);
	printf(" enter the marks of m2 ");
	scanf("%f", &m2);
	printf("enter the marks of m3 ");
	scanf("%f", &m3);
	total= m1+m2+m3;
	printf("\n the total mark is %.2f ",total);
	per = (total/300)*100;
	avg = (total/3);
	printf("\n the percentage mark is : %.2f ", per);
	printf("\n the average mark  is: %.2f", avg);

	///// Grade calculation //
	if(per>=100) printf("no credits above 100");
        else if(per>=80) printf("\n Grade : A")
	else if(per>=60) printf("\n Grade : B");
	else if(per>=40) printf("\n Grade : C");
	else if(per<40) printf("\n Fail ");

	getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog