Answer to Question #261227 in C for bubbles

Question #261227
  • Write a program that prompts the user to input: 4 quizzes, 4 laboratory exercises and 4 assignments in percentage for Class Participation.
  • The program should output the average of quizzes, laboratory exercises and assignments and compute the equivalent percentage by getting the 40%.
  • The user will input the major examination and get the equivalent by getting the 60% of it.
  • The program should output the Prelim Grade:
  • Prelim Grade = class participation + major examination
  • Remarks: if the grade is greater than or equal to 75 display PASSED, otherwise FAILED

SAMPLE RUN:

Class Participation

               Quiz 1: 90

               Quiz 2: 95

               Quiz 3: 89

Quiz 4: 80

                               Average: 88.5

               Lab. 1:  100

               Lab. 2:  95

               Lab. 3: 80

Lab 4: 70

                               Average: 86.25

               Assignment 1:  100

               Assignment 2:  80

               Assignment 3:  89

Assignment 4: 75

                               Average: 86

                Class Participation: 34.73

Prelim Exam: 95

              %: 57.00

Prelim Grade: 91.73

Remarks: PASSED


1
Expert's answer
2021-11-04T16:26:05-0400
#include<stdio.h>
int main(){
	
	printf("Class Participation\n");
	int i;
	float sum = 0.0;
	for(i=0; i<4; i++){
		printf("Quiz %d:  ", (i+1));
		float quiz;
		scanf("%f", &quiz);
		sum += quiz;
		
	}
	float average = sum / 4;
	printf("Average: %f\n", average);
	int n;
	float sum_lab = 0.0;
	for(n=0; n<4; n++){
		printf("Lab.  %d:  ", (n+1));
		float lab;
		scanf("%f", &lab);
		sum_lab += lab;
		
	}
	float average_lab = sum_lab / 4;
	printf("Average: %f\n", average_lab);
	
	
	int j;
	float sum_assignment = 0.0;
	for(j=0; j<4; j++){
		printf("Assignment  %d:  ", (j+1));
		float assignment;
		scanf("%f", &assignment);
		sum_assignment += assignment;
		
	}
	float average_assignment = sum_assignment / 4;
	printf("Average: %f\n", average_assignment);
    
    float class_participation = (average_assignment + sum_assignment + average) * 0.4;
    printf("Prelim Exam:  %f\n", class_participation);
    float exam;
    scanf("%f", &exam);
    float total = class_participation + (exam * 0.6);
    
	 
}

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
APPROVED BY CLIENTS