Question

Write down a Cre program on computer that calculates the grades of the stud f the students for the marks by using if else statements for the following conditions. Marks 60 Grade D Marks > 60 &&70 Grade C Marks > 70 &&80 Grade B Marks > 80 && 90 Grade A Marks> 90 && -100 Grade A+
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <iostream>
using namespace std;
int main()
{
int n,a[10],Marks,total=0,i;
cout<<"Enter number of subjects";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"Enter marks for subject "<<i<<":";
cin>>a[i];
total=total+a[i];
}
Marks=total/n;
cout<<"Total Marks are:"<<Marks<<endl;
if(Marks<=60)
{
cout<<"Grade D"<<endl;
}
else if(Marks>60 && Marks<=70)
{
cout<<"Grade C"<<endl;
}
else if(Marks>70 && Marks<=80)
{
cout<<"Grade B"<<endl;
}
else if(Marks>80 && Marks<=90)
{
cout<<"Grade A"<<endl;
}
else if(Marks>90 && Marks<=100)
{
cout<<"Grade A+"<<endl;
}
return 0;
}

ㅃ main.cop lgrade1]-Code-Blocks 16.01 ile Edit Yiew Search Project Build Debug Fortrap wSmith Jools Tools Plugins DoxyBlocks Settings Help main(): int main.cppx Projects Symbols grade1 EAstudyiagrade1.cgrade 1binDebugigrade1.exe Sources Enter number of subjects:6 Enter marks for subject 1:50 Enter marks for subject 2:70 Enter marks for subject 3:56 Enter marks for subject 4:78 Enter marks for subject 5:65 Enter marks for subject 6:46 Total Marks are: 6e Grade D rrain.cpp Process returned e (0x) execution time 17.458 s Press any key to continue Windows (CR+LF) WINDOWS-125 Line 6, Calumn 37 Insert Read/Write detault ENG 20:51

Add a comment
Know the answer?
Add Answer to:
Write down a Cre program on computer that calculates the grades of the stud f the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please use the c language Assignment 12 The program to write in this assignment is a...

    please use the c language Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 scores 201 1710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student id...

  • Write a Python Program Display the grades: Input: Enter the marks of the student Condition: Grade...

    Write a Python Program Display the grades: Input: Enter the marks of the student Condition: Grade A: Marks greater than 90 Grade B: Marks range from 81 to 90 Grade C: Marks range from 65 to 80 Fail: less than 65 Display the output. Example: Input: 95 Display: “student got Grade A” Input: 80 Display: “student got Grade C” Input: 64 Display: “student failed” Hint: Use else if (elif and logical operators)

  • C++ Write a program that reads the number of students in the class, then reads each...

    C++ Write a program that reads the number of students in the class, then reads each student's name and his/her test score. Print out each student name, test score and grade, and the average score of the whole class. The program must use vectors and loops for the implementation. The grades are determined as follows: A >= 90; 80 <= B < 90; 70 <= C < 80; 60 <= D < 70; F < 60.

  • in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment...

    in C porgraming . use #include〈stdio.h〉 #include〈stdlib.h〉 Assignment 12 The program to write in this assignment is a program that calculates score statistics and manages the grades of the students. First, the student list and scores are given in a file named "student.dat" as in the following: 이성우 77 홍길동 88 2011710086 2012700091 This program reads the input file "student.dat" and keeps this data in a linear linked list. Each node must be a struct which contains the following: student_id,...

  • using C# Write a program which calculates student grades for multiple assignments as well as the...

    using C# Write a program which calculates student grades for multiple assignments as well as the per-assignment average. The user should first input the total number of assignments. Then, the user should enter the name of a student as well as a grade for each assignment. After entering the student the user should be asked to enter "Y" if there are more students to enter or "N" if there is not ("N" by default). The user should be able to...

  • using C geany. Please Dr. exercise # 1 and 2 During the lab: PART I: PROGRAMMING...

    using C geany. Please Dr. exercise # 1 and 2 During the lab: PART I: PROGRAMMING EXERCISES a. Using Geany, write a C program that prompts and asks the user for two assignment marks (al and a2) and two test marks (ti and t2). All four variables are integer variables and are in % (out of 100). You program should display the four marks properly lalebed to check if the input has been successful. b. Next, calculate and display the...

  • Within this C program change the input to a file instead of individual input from the...

    Within this C program change the input to a file instead of individual input from the user. You must take the input file name on the command line. Be sure to have simple error checking to be sure the file exists and was successfully opened. The input file will have the following format: First line: Number of students Second Line: Number of grades Third Line: Student Names, space delimited Fourth+ Line(s): Grades for all students for one assignment, space delimited....

  • Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in...

    Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in a course. The final grades are given in an array. The fail grade is 60. Example: Array and Output      .data NoOfStudents: 10 Values:   60 70 80 50 90 80 55 90 80 70 Output: 2 students failed      .data NoOfStudents: 12 Values:   60 70 80 50 90 80 55 90 80 70 55 80 Output: 3 students failed

  • using C language Programming Question 1 Write a C program that takes students marks from a...

    using C language Programming Question 1 Write a C program that takes students marks from a user, one by one until -1" is entered, which would indicate that no other marks are available, and the program terminates. For each mark the program will decide the student grade as: Fail, if mark < 60 • D. if 60<= mark <=70 • C. if 70<=mark <=80 • B. if 80c= mark <=90 • A. if 90cmark <=100 -T -- E - 15203...

  • Write a Java program: Given an int array grades int[] grades={89, 80, 78, 60, 38, 92,...

    Write a Java program: Given an int array grades int[] grades={89, 80, 78, 60, 38, 92, 72, 88}, find how many “B” among these grades, (80<=B<90) Print out how many “B”s in this grade.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT