Question

In: Computer Science

(c++ programming) We want to assign a letter grade based on the following scaling chart. Write...

(c++ programming) We want to assign a letter grade based on the following scaling chart. Write a program to do it Enter your score: 85 Your grade is a “B” 0-------------------60---------70-------------80-----------90-------------100 F D C B A MUST use nested if-else statements.

Solutions

Expert Solution

C++ Code

#include <iostream>
using namespace std;

int main()
{

float score;
cout<<"Enter your Score : ";
cin>>score; // input the score
if(score>=100 && score<=90) //checking the score is between 100 and 90
{
cout<<"Your grade is A";
}
else if(score>=80 && score<90) //checking the score is between 80 and 90
{
cout<<"Your grade is B";
}
else if(score>=70 && score<80) //checking the score is between 70 and 80
{
cout<<"Your grade is C";
}
else if(score>=60 && score<70) //checking the score is between 60 and 70
{
cout<<"Your grade is D";
}
else
{
cout<<"Your grade is F"; // display if score is less than 60
}
return 0;
}

Output


Related Solutions

write a Java program Write a program to assign a letter grade according to the following...
write a Java program Write a program to assign a letter grade according to the following scheme: A: total score >= 90 B: 80 <= total score < 90 C: 70 <= total score < 80 D: 60 <= total score < 70 F: total score < 60 Output - the student's total score (float, 2 decimals) and letter grade Testing - test your program with the following input data: test1 = 95; test2 = 80; final = 90; assignments...
Write a c++ program that given a set of letter grade/credit hour combiniation, determines the grade...
Write a c++ program that given a set of letter grade/credit hour combiniation, determines the grade point average (GPA) Each A is worth 4 points. Each B is worth 3 points. Each C is worth 2 points. Each D is worth 1 point, and Each F is worth 0 points. The total quality points earned is the sum of the product of letter grade points and associated course credit hours. The GPA is the quotient of the quality points divided...
Write a C program that calculates a student grade in the C Programming Class. Ask the...
Write a C program that calculates a student grade in the C Programming Class. Ask the user to enter the grades for each one of the assignments completed in class: Quiz #1 - 25 points Quiz #2 - 50 points Quiz #3 - 30 points Project #1 - 100 points Project #2 - 100 points Final Test - 100 points The total of the quizzes count for a 30% of the total grade, the total of the projects counts for...
Write a program that uses a dictionary to assign “codes” to each letter of the alphabet....
Write a program that uses a dictionary to assign “codes” to each letter of the alphabet. For example:      codes = {'A':'%', 'a':'9', 'B':'@', 'b':'#', etc....} Using this example, the letter “A” would be assigned the symbol %, the letter “a” would be assigned the number 9, the letter “B” would be assigned the symbol “@” and so forth. The program should open a specified text file, read its contents, and then use the dictionary to write an encrypted version of...
The following is for C programming language: I want to scan for initials in a line...
The following is for C programming language: I want to scan for initials in a line of text. my line of text is as follows: 12345 3.5000 a j 12346 4.1000 s p The first number represents the student ID, the second number represents the gpa, the third character represents the first initial and the fourth character represents the last initial of the student. My text file contains these values. The following is my code: fscanf(fp, "%d %c %c", &studentID,...
C Programming Language Problem Title : 4th Grade Jojo just graduated and moved up to grade...
C Programming Language Problem Title : 4th Grade Jojo just graduated and moved up to grade 4. Today is his first day in 4th grade. Unfortunately, the lessons are held online because of pandemic. So that the quality of learning remains good, Jojo’s teacher gives a hard task for 4th grader. The first task is to find the prime factorization of a number. Prime number is a natural number greater than 1 that is not a product of two smaller...
C++ PROGRAMMING In the linked-list based bag implementation, we demonstrated the functionalities, such as, add, remove,...
C++ PROGRAMMING In the linked-list based bag implementation, we demonstrated the functionalities, such as, add, remove, and list. This assignment is to extend the functionalities of the bag with other operations average, min, and max, You need to extend the Bag class (under Wk 2, BagLinked_List.cpp) with the following methods: -int Bag::min( ), is to find minimum of items of the bag. -int Bag::max( ), is to find maximum of items of the bag -float Bag::ave( ), is to find...
Based on the information below, create a project schedule (Gantt Chart). Assign tasks to either Workgroup...
Based on the information below, create a project schedule (Gantt Chart). Assign tasks to either Workgroup or Individual. Project: Vacation Team: "Workgroup 1", "Individual" Start/End: February 19 - May 26 START A. February 19: Vacation participation must be confirmed Time allotted: 7 days i. Confirm participation Time needed: 1 day ii. Research vacation deals Time needed: 1 days iii. Decide on destination Time needed: 2 days iv. Create travel list Time needed: 1 day Slack available: 2 days B. February...
A teacher is trying to assign grades so that she has the following distribution: Grade %...
A teacher is trying to assign grades so that she has the following distribution: Grade % of Class A 15 B 30 C 40 D 10 F 5 This is what she actually has in her grade book: Grade # Students A 20 B 40 C 35 D 8 F 8 At a significance level of 0.05, are these two distributions different? Include either χ2 or the p-value to justify your answer.
A humanities professor sent a letter grade on a test according to the following scheme. A:...
A humanities professor sent a letter grade on a test according to the following scheme. A: top 12% scores. B: Score is below 12% and above the bottom 58%. C: score is below the top 42% and above the bottom 25% . D: scores below top 75% and above bottom 8% . F: bottom 8% of scores. Scores on tests are normally distributed with a mean of 78.9 and a standard deviation of 9.3.Find the minimum score required for an...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT