Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help! can seem to figure out 7.9 Run sci2-7.9 C 10 W main.cpp Loading... 1 #incude 2 3 using namespace std; 4 5 struct

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
need help! can seem to figure out 7.9
Run sci2-7.9 C 10 W main.cpp Loading... 1 #incude 2 3 using namespace std; 4 5 struct student 6 { 7 char firstname [10]; 8 char lastname [10]; 9 char grade; 10 int quiz (10); 11 12 }; 13 14 int main() 15 { 16 int n, i, sum; 17 cout>n; 19 cout>a[i].firstname; 26 cin>>a[1]. lastname; 27 suma; 29 30 cout>alil quiz lil: 28 vain.cpp 23 for(int i=0;i>a[i].firstname; 26 cin>>a[i]. lastname; 27 28 sum=0; 29 30 cout>a[i].quiz[j]; 34 sum+=a[i].quiz[j]; 35 } 36 cout=90) 38 { 39 cout=80) 43 { cout=70) 48 { 49 cout=60) 53 54 cout=60) { cout return; P7.8 Define a structure Student with a first name, last name, and course grade (A, B, C, D, or F). Write a program that reads input in which each line has the first and last name and course grade, separated by spaces. Upon reading the input, your program should print all students with grade A, then all students with grade B, and so on. ..p7.9 Enhance the program in Exercise. P28 so that each student has ten quiz scores. The input contains the student names and quiz scores but no course grades. The program should compute the course grade. If the sum of the quiz scores is at least 90, the grade is an A. If the sum is at least 80, the grade is a B, and so on. Therl print all students with grade A together with their individual quiz scores, followed by all students with grade B, and so on. > clang++-7 -pthread -std=C++17 -o main main.cpp ./main Enter the Number of Students: 2 Enter Firstname Lastname and QuizvGrade of all students: Christian Juarez Enter 2 subject quiz between 0-10 A SUT=-523083583Fail Enter 2 subject quiz between 0-10 sum10872 50126Fail The sorted list is: Christian Juarez F F<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago