Question: ion Handling 1 Question ( 3 Points ) 1 . Write the Code for the Following Pseudocode: # Save a user input for Whether the

ion Handling 1 Question (3 Points)
1. Write the Code for the Following Pseudocode:
# Save a user input for Whether the temperature changed to var ask
while ask.lower()[0]=='y':
# Save a user input for Current Temperature to var temp as an integer
#exception handling:
# prompt the user for an integer input
# read the input and convert it to an integer if possible
# if it not possible, ask for the temperature again do this as many times as needed.
#
#
# if the integer is 100 or more, print "it is hot"
#
# if the integer is 60 or less, print "it is cold"
#
# 61 and 99 inclusive, print "it is just right"
#
# ask again whether the temperature changed, re-assigning var ask
#
# Say goodbye once the loop is finishes
Loops
1. Nested loop: (3 Points)
#use a nested loop to build the following:
#print the following (n=5):
#****1
#***21
#**321
#*4321
#54321
#right aligned
#two or more layered loop
#space between each character
#generalizable to any n maximum length (here n=5)
#before last line, replace missing digits with stars (e.g.4-->* and 10-->**)
Functions
1. Write LOOPS.2 as a function with input n with the same functionality (2 Points)
a. Output is a string containing everything that was printed, with line breaks separating
lines e.g.: ****1
***21
........

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!