Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

## Challenge 1 ##################### # Create a function which asks a user to type a season, spring, summer , fall, winter. # Depending on which

## Challenge 1 ##################### # Create a function which asks a user to type a season, spring, summer , fall, winter. # Depending on which season they type, print a seasonal statement. CAll the function # by passing the variable holding the user's season. Please ensure the inout is not case-sensitive. # For example Winter is the same as winter is the same as WINTER. # also inlcude a print statement if the user entered a word which is not a season. # Output messages as follows # for Spring, "April showers bring May Flowers" # For Summer, "It's Beach time" # For Fall, "It's time for Turkey Day" # For Winter, "Snowman Season" # For an incorrect season, "Plese enter either Spring, Summer, Winter or Fall"

""" Expected Output

please enter a season for a message SPRING April showers bring May Flowers

please enter a season for a message Spring April showers bring May Flowers

please enter a season for a message spring April showers bring May Flowers

please enter a season for a message pre spring Plese enter either Spring, Summer, Winter or Fall

"""

## Challenge 1 code goes here#####################

## Challenge 2 ##################### # Error Handling # Practice error handling by writing a function to print the square of an integer and return the square # to the main part of the program and print it out. If the user should enter a decimal (float) in error, # let the user know to only enter a whole nmuber (integer) the program should run and not generate any #system errors.

""" Expected Output Please enter an integer to get its square root: 10 The square of 10 is 100

Please enter an integer to get its square root: 2.3 Your entry was not a whole number, please enter an whole number

Please enter an integer to get its square root: go away Your entry was not a whole number, please enter an whole number

"""

## Challenge 2 code goes here#####################

## Challenge 3 ##################### # Combining what we learned # we've learned a lot over the last few weeks. Let's put that to use # Create a code block which consists for a function to average grades #The function should be able to take any number of grades # Caluclate the average of the grades and return it to the main prgram # in the main program use the average returned and test it to determine a letter grade # 90 and up is A, 80 to 89 is a B, 70 to 79 is a C 60 to 69 a D and below 60 is an F.

##HINT, you tested for grades before, right, reuse the code. Code resuse is one of the best ways to #things done quickly

""" Expected Output given 100,100,70,60 Your grade averages is 82.5 which is a B """

## Challenge 3 code goes here#####################

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

Chapter Eleven Real-world Case #1

Answered: 1 week ago