Question

PYTHON SCRIPT Your parents have promised to buy you a game system depending on your grade...

PYTHON SCRIPT

Your parents have promised to buy you a game system depending on your grade point average (GPA). If your GPA is in between 3.0 and 3.5, inclusive, then you will get a Wii. If your GPA is greater than 3.5 but less than or equal to 3.8, you will get a Kinect. If your GPA is greater than 3.8, you will get a Playstation 3. Write a program that prompts the user for their GPA and prints out which game system, if any, they will get.

Sample Program Run #1

What is your GPA?

2.8

Sorry, you do not get a game system.

Sample Program Run #2

What is your GPA?

3.6

Great, you will get a Kinect for your good grades!

Homework Answers

Answer #1

n=float(input("What is your GPA?"))

if n>3.0 and n<=3.5:

     print("Great,you will get a Wii for your good grades!")

elif n>3.5 and n<=3.8:

     print("Great,you will get a Kinect for your good grades!")

elif n>3.8:

     print("Great,you will get a Playstation 3 for your good grades!")

else:

     print("Sorry,you do not get a game system.")

Explanation:

GPA is a float value so we convert from string to float

and stored in the n and compare the n according to the given conditions.

: is required at the if conditions and python follows indentation.

Know the answer?
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
Similar Questions
PYTHON SCRIPT Your parents pay you $3 for each trash bag full of leaves you take....
PYTHON SCRIPT Your parents pay you $3 for each trash bag full of leaves you take. If you can fill more than 10 bags in a month, they give you a bonus of $20. Write a program that asks the user how many bags of leaves they filled in the past month and prints out the total amount of money they made. For example, if someone fills 8 bags in a month, they would get $24. But, if they fill...
The first script you need to write is login.sh, a simple script that you might run...
The first script you need to write is login.sh, a simple script that you might run when you first log in to a machine. We'll expand this script later, but for now it should include your name, username, hostname, current directory, and the current time. Here is some sample output to help guide you. Note that the bolded lines that start with "[user@localhost ~]$" are the terminal prompts where you type in a command, not part of the script. Of...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT