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 program that translates a letter grade into a number grade. Letter grades are A,...
Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and F, possibly followed by + or -. Their numeric values are 4, 3, 2, 1 and 0. There is no F+ or F-. A “+” increases the numeric value by 0.3, a “–“ decreases it by 0.3. However, an A+ has value 4.0.4 pts Enter a Letter grade: B- The numeric value is 2.7 Your code with comments A screenshot...
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...
I want to create a seating chart that I can assign an 'X' to if a...
I want to create a seating chart that I can assign an 'X' to if a seat is purchased. I want to use a numpy array, but am having trouble figuring out how to write it the way I want it. I want it 4 X 15, but with string values instead of all the same value or a range. i would like this. can I do it with numpy? also I want the columns lined up when i do...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT