would like a zoomed out picture of the code. I had to send this twice cause the last one was blurry and the paper was blank.IN P

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Please I would like a zoomed out picture of the code. I had to send this twice cause the last one was blurry and the paper was blank.IN PYTHON PLEASE
Problem 3 (Ceiling or Floor)
Write a program called p3.py that has the following functionality:
1. Add a main() function to your program and create a one-dimensional list (empty to
start) in this function.
2. Prompt the user to enter a number (int or float, validation is not required).
3. Add the user input to the empty list as a float.
4. Continue steps 2 and 3 until the user enters 'q' or 'Q'.
5. Print all numbers stored in the list.
6.
Ask the user if they would like the ceiling or the floor values of all the numbers. The
user should enter 'c' for ceiling and 'f' for floor. The input should be validated and if
incorrect, the user should be prompted again.
7. The program should print each of the ceilings/floors of the numbers in the list, making
use of the ceil() and floor() functions from the math module (you can check this link
know more about
ceil and floor functions in python
https://docs.python.org/3/library/math.html).
to
8. Try to write helper functions to do certain functionality where it makes sense and call
those functions in the main() to execute the entire program.
Hints: try to write at least three functions to (i) take inputs until the user decides to
quit, (ii) print the ceil values of the numbers stored in the list, and (iii) print the floor
values of the numbers stored in the list. Make sure to use the necessary parameter(s)
in each function definition and call these functions with appropriate argument(s).
9. Include the guard for the main function:
if
1
name
main':
main ()
Sample output:
Enter a number: 43.2
Enter a number: 95
Enter a number: 2.9
Enter a number:
List contains the following numbers:
43.2
95.0
2.9
Ceiling (c) or floor (f) ? £
43
95
2
Page 4 of 4
4/4
200
Transcribed Image Text:Problem 3 (Ceiling or Floor) Write a program called p3.py that has the following functionality: 1. Add a main() function to your program and create a one-dimensional list (empty to start) in this function. 2. Prompt the user to enter a number (int or float, validation is not required). 3. Add the user input to the empty list as a float. 4. Continue steps 2 and 3 until the user enters 'q' or 'Q'. 5. Print all numbers stored in the list. 6. Ask the user if they would like the ceiling or the floor values of all the numbers. The user should enter 'c' for ceiling and 'f' for floor. The input should be validated and if incorrect, the user should be prompted again. 7. The program should print each of the ceilings/floors of the numbers in the list, making use of the ceil() and floor() functions from the math module (you can check this link know more about ceil and floor functions in python https://docs.python.org/3/library/math.html). to 8. Try to write helper functions to do certain functionality where it makes sense and call those functions in the main() to execute the entire program. Hints: try to write at least three functions to (i) take inputs until the user decides to quit, (ii) print the ceil values of the numbers stored in the list, and (iii) print the floor values of the numbers stored in the list. Make sure to use the necessary parameter(s) in each function definition and call these functions with appropriate argument(s). 9. Include the guard for the main function: if 1 name main': main () Sample output: Enter a number: 43.2 Enter a number: 95 Enter a number: 2.9 Enter a number: List contains the following numbers: 43.2 95.0 2.9 Ceiling (c) or floor (f) ? £ 43 95 2 Page 4 of 4 4/4 200
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
InputStream
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education