Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Let's create a GPA Calculator Program! Complete the following lines of code: a. Create a variable called letter_grade and set its value to user

image text in transcribed
2. Let's create a GPA Calculator Program! Complete the following lines of code: a. Create a variable called letter_grade and set its value to user input. You may be creative with the input prompt, but it should indicate to the user to enter a letter grade (A, B, C, D, or F) Ill. la Fise b. Create a set of if/elif/else statements. Each statement should behave in the following manner: 1. If letter_grade is equal to the string "A", then create a variable called gpa and set its value to 4.0 ii. Else, if letter_grade is equal to the string "B", then create a variable called gpa and set its value to 3.0 Else, if letter_grade is equal to the string "C", then create a variable called gpa and set its value to 2.0 iv. Else, if letter_grade is equal to the string "D", then create a variable called gpa and set its value to 1.0 v. Else, if letter_grade is equal to the string "F", then create a variable called gpa and set its value to 0.0 vi. Else, create a variable called gpo and set its value to -1.0 c. Output the message "Your GPA is" and then output the value of apa on the same line

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions