lease use the 4 functions in the starter code, thank you! 1.  Format your code as provided in the Lab 2 Start Code provided below. 2. The user prompt for a size will be: "Please input your staircase size:" 3. Perform a function call within the exception handling logic (Your function that contains the code to run the program should be within a try/except block - see comments in the starter code). 4. Raise and Handle the following exceptions:        - A custom exception called "IntegerOutOfRangeException" when the user provides an integer value that is not within the valid integer range.  ("That staircase size is out of range.")        - A custom exception called "NoStairCaseException" when the user provides a staircase size of 0. ("There are no steps in the staircase.")       - In ValueError for user input that are not integers. ("There are no steps in the staircase.") 5. The error messages for the above exceptions should be the same as above and printed to the shell. 6. The program should continue to run and request a new input until the user types the word "DONE"

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Please use the 4 functions in the starter code, thank you!

1.  Format your code as provided in the Lab 2 Start Code provided below.

2. The user prompt for a size will be: "Please input your staircase size:"

3. Perform a function call within the exception handling logic (Your function that contains the code to run the program should be within a try/except block - see comments in the starter code).

4. Raise and Handle the following exceptions:

       - A custom exception called "IntegerOutOfRangeException" when the user provides an integer value that is not within the valid integer range.  ("That staircase size is out of range.")

       - A custom exception called "NoStairCaseException" when the user provides a staircase size of 0. ("There are no steps in the staircase.")

      - In ValueError for user input that are not integers. ("There are no steps in the staircase.")

5. The error messages for the above exceptions should be the same as above and printed to the shell.

6. The program should continue to run and request a new input until the user types the word "DONE"

1. Format your code as provided in the Lab 2 Start Code provided below.
2. The user prompt for a size will be: "Please input your stair case size:"
3. Perform a function call within the exception handling logic (Your function that contains the code to run the program should be within a
try/except block - see comments in the starter code).
4. Raise and Handle the following exceptions:
A custom exception called "IntegerOutOfRangeException" when the user provides an integer value that is not within the valid integer
range. ("That staircase size is out of range.")
- A custom exception called "NoStairCaseException" when the user provides a staircase size of 0. ("There are no steps in the staircase.")
- In ValueError for user input that are not integers. ("There are no steps in the staircase.")
5. The error messages for the above exceptions should be the same as above and printed to the shell.
6. The program should continue to run and request a new input until the user types the word "DONE"
7. Use this start code to being your project. You can use your code from lab1. (Only your code not anyone else's).
1
" This functions asks the user for the number of steps
94 A7 X4 ^ v
they want to climb, gets the value provided by the user
and returns it to the calling function. This function will
Araise any exceptions related to none integer user inputs.
4
def getUserInput():
6.
#your code belongs here
7
8
'' This function takes the number of steps as an unput parameter,
6.
creates a string that contains the entire steps based on the user input
10
and returns the steps string to the calling function. This function will raise
11
any exceptions resulting from invalid integer values.
12
13
def printSteps(stepCount):
14
#your code belongs here
15
''This function kicks off the running of your program. Once it starts
it will continuosly run your program until the user explicitly chooses to
16
17
18
end the running of the program based on the requirements. Thie function returns
19
the string "Done Executing" when it ends. Addtionally, all exceptions will be
20
Ahandled (caught) within this function.
21
def runProgram():
22
#your code belongs here
23
24
'''Within this condition statement you are to write the code that kicks off
25
your program. When testing your code the code below this
should be the only code not in a function and must be within the if
Astatement. I will explain this if statement later in the course. !"
26
27
if -_name__ == "__main__":
%3D
28
29
#your code belongs here
30
31
32
33
Transcribed Image Text:1. Format your code as provided in the Lab 2 Start Code provided below. 2. The user prompt for a size will be: "Please input your stair case size:" 3. Perform a function call within the exception handling logic (Your function that contains the code to run the program should be within a try/except block - see comments in the starter code). 4. Raise and Handle the following exceptions: A custom exception called "IntegerOutOfRangeException" when the user provides an integer value that is not within the valid integer range. ("That staircase size is out of range.") - A custom exception called "NoStairCaseException" when the user provides a staircase size of 0. ("There are no steps in the staircase.") - In ValueError for user input that are not integers. ("There are no steps in the staircase.") 5. The error messages for the above exceptions should be the same as above and printed to the shell. 6. The program should continue to run and request a new input until the user types the word "DONE" 7. Use this start code to being your project. You can use your code from lab1. (Only your code not anyone else's). 1 " This functions asks the user for the number of steps 94 A7 X4 ^ v they want to climb, gets the value provided by the user and returns it to the calling function. This function will Araise any exceptions related to none integer user inputs. 4 def getUserInput(): 6. #your code belongs here 7 8 '' This function takes the number of steps as an unput parameter, 6. creates a string that contains the entire steps based on the user input 10 and returns the steps string to the calling function. This function will raise 11 any exceptions resulting from invalid integer values. 12 13 def printSteps(stepCount): 14 #your code belongs here 15 ''This function kicks off the running of your program. Once it starts it will continuosly run your program until the user explicitly chooses to 16 17 18 end the running of the program based on the requirements. Thie function returns 19 the string "Done Executing" when it ends. Addtionally, all exceptions will be 20 Ahandled (caught) within this function. 21 def runProgram(): 22 #your code belongs here 23 24 '''Within this condition statement you are to write the code that kicks off 25 your program. When testing your code the code below this should be the only code not in a function and must be within the if Astatement. I will explain this if statement later in the course. !" 26 27 if -_name__ == "__main__": %3D 28 29 #your code belongs here 30 31 32 33
Please input your stair case size: 1
+-+
+-+
Please input your stair case size: 3
+-+
| |
+-+-+
| |
+-+-+
| |
+-+
Please input your stair case size: 5
+-+
%3D
+-+-+
| |
+-+-+
+-+-+
| |
+-+-+
| |
+-+
-
Transcribed Image Text:Please input your stair case size: 1 +-+ +-+ Please input your stair case size: 3 +-+ | | +-+-+ | | +-+-+ | | +-+ Please input your stair case size: 5 +-+ %3D +-+-+ | | +-+-+ +-+-+ | | +-+-+ | | +-+ -
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY