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 java program to read a list of exam grades given as int's in the...

    Write a java program to read a list of exam grades given as int's in the range of 0 to 100. Your program will display the total number of grades and the number of grades in each letter-grade category as follows: A 93 <= grade <= 100 A- 90 <= grade < 93 B+ 87 <= grade < 90 B 83 <= grade < 87 B- 80 <= grade < 83 C+ 77 <= grade < 80 C 73 <=...

  • 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 python, Write a program to output grades A, B, C, D, F depending on the...

    In python, Write a program to output grades A, B, C, D, F depending on the scores to be lying between 90 and 100, 80 and 89, 70 and 79, 60 and 69 (inclusive of the end points). If the user inputs numbers less than zero or greater than 100, print “Error! Try again!” Thank you

  • 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...

  • This program has to be made in java also will but uploaded on zybooks Write a...

    This program has to be made in java also will but uploaded on zybooks Write a program in Java to read a list of exam grades given as int's in the range of 0 to 100. Your program will display the total number of grades and the number of grades in each letter-grade category as follows: A 93 <= grade <= 100 A- 90 <= grade < 93 B+ 87 <= grade < 90 B 83 <= grade < 87...

  • 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

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