Docsity

Lab 8 Using if Statements - Introduction Computer Concepts | CSCE 101, Lab Reports of Computer Science

Toggle sidebar
bg1
Lab 8
Using if statements
The semester is finally over and you want to determine whether you received a B or better in CSCE 101.
You have received all of your grades from your instructor and you also know the following weights for
each grade and the letter grade distribution:
Tests 1 & 2 20% each, lab 30%, quizzes 10%, and final exam 20%
A = 90-100, B = 80-89, C = 70-79, D = 60-69, F <60
Write a program to print out your numeric final course grade and a message to indicate whether you
received a B or better in the course. You may use the following steps as a guide.
Declare five floating point variables called Test1, Test2, Lab, Quiz, and Final.
Declare an integer variable called Course_Grade
For each if the variables excluding Course_Grade, output a phrase asking the user to input the grade
and then write an input statement to input the grade.
Write a formula for Course_Grade based on the aforementioned weights and declared variables. The
course grade is the sum of each grade multiplied by its fractional weight. Do not use exact numbers in
the formula.
Output the numeric value of your course grade.
Use an if statement to determine if you received a B or better in the course. If you did, output the
phrase “Congratulations!” If you did not, output the phrase “Sorry! You didn’t make the B”.

Partial preview of the text

Download Lab 8 Using if Statements - Introduction Computer Concepts | CSCE 101 and more Lab Reports Computer Science in PDF only on Docsity!

Lab 8 Using if statements The semester is finally over and you want to determine whether you received a B or better in CSCE 101. You have received all of your grades from your instructor and you also know the following weights for each grade and the letter grade distribution:  Tests 1 & 2 20% each, lab 30%, quizzes 10%, and final exam 20%  A = 90-100, B = 80-89, C = 70-79, D = 60-69, F < Write a program to print out your numeric final course grade and a message to indicate whether you received a B or better in the course. You may use the following steps as a guide.  Declare five floating point variables called Test1, Test2, Lab, Quiz, and Final.  Declare an integer variable called Course_Grade  For each if the variables excluding Course_Grade, output a phrase asking the user to input the grade and then write an input statement to input the grade.  Write a formula for Course_Grade based on the aforementioned weights and declared variables. The course grade is the sum of each grade multiplied by its fractional weight. Do not use exact numbers in the formula.  Output the numeric value of your course grade.  Use an if statement to determine if you received a B or better in the course. If you did, output the phrase “Congratulations!” If you did not, output the phrase “Sorry! You didn’t make the B”.