![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
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](https://content.bartleby.com/qna-images/question/9e2b96c1-3468-437a-a294-6f714c454d95/cde18307-0426-4ecc-9f47-c54ed2ac9b15/p4oiudk_thumbnail.jpeg)
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
![Check Mark](/static/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 2 images
![Blurred answer](/static/blurred-answer.jpg)
Knowledge Booster
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
- In Python, utilize the file pylang.txt (information included in the file py.lang.txt below) pylang.txt ————— Python language is incredibly easy to use and learn for new beginners and newcomers. The python language is one of the most accessible programming languages available because it has simplified syntax and not complicated, which gives more emphasis on natural language. Due to its ease of learning and usage, python codes can be easily written and executed much faster than other programming languages. ——————————————- Create a program that replaces every occurrence of a string from the file above with a user-selected word. The program should prompt user to enter the filename, a string to be substituted and a string to substitute it with. The program will open a file to read, then close the file. Replace one string with another, then open the file to write out the new string, then close it. Then finally, open the file to read again so the new context can be printed.…arrow_forwardThis Python script is full of syntax, runtime, and semantic errors. Please identify and correct these errors, such that code becomes fully executable and outputs the following message on the screen when running from the Git Bash command line The life expectancy for the millennials is projected to be 120 years! (But don't believe it...) A recent study published in the journal of Nature, discovered that over the past century, although life expectancy has significantly increased due to technological advances, the maximum life span of the oldest people in the world has not changed much. Cardano was the first to introduce complex numbers of the form a + sqrt(-b) into algebra, but he had misgivings about it. In his solution to an algebra equation, he encountered the solution 5 + sqrt(-15) for the unknown, which is now mathematically represented by (5+3.872983346207417j) in Python, which can also be obtained as the addition of real and imaginary numbers in Python like this 5 + sqrt(-15) =…arrow_forwardCan i have answers for questions 3 and 7 with output in JupiterNotebo please! Plotting Programming Assignment Plotting Please follow the instructions to complete the following Python programs. For each program, please also provide your own testing cases. Please complete them in either Jupter notebook or with py file and submit your programs and running results. real estate transaction.csv file Create a grid of scatter plots with each one representing the sq_ft distribution in a single zipcode, please also include ticks, labels and legend in your plot Create a grid of scatter plots with each one representing the price distribution in a single zipcode, annotate the highest and lowest price ones for each category of real-estate: condo, residential and multi-family, please also include ticks, labels and legend in your plot Create a grid of bar plots with each one representing a single zipcode and in that zipcode the sq_ft distribution is grouped by the category of condo, residential and…arrow_forward
- please answer the image using python codearrow_forwardFor this lab you will do 2 things: Solve the problem using pseudocode Code it in Python When you are finished, submit both your pseudocode and your program code. Use MS Word to write your pseudocode, paying attention to comments and the indentation of code blocks. When done, save the file as a PDF. Your source code, written using Python, will produce a *.py file. Upload both the *.pdf and the *.py file (at the same time). Bank Charges A bank charges $10 per month plus the following check fees for a commercial checking account: $.10 each for less than 20 checks $.08 each for 20 - 39 checks $.06 each for 40 - 59 checks $.04 each for 60 or more checks Write a program that prompts the user for the number of checks written for a month, then compute and display the bank's total service fees for the month. Make sure the output displays with a $ and 2 decimal…arrow_forwardInstructions in python: Create a compression algorithm that will compress the text "nnneennwnneeeennwwnneeeessseeenneeesswsswwwsssswww" in the parchment piece into a smaller form. The algorithm must include simple instructions of no more than 1 or 2 sentences. It is recommended that you use basic ASCII characters, as the focus here is the algorithm rather than the physical space occupied by the result. Create a copy of this spreadsheet to organize your results and calculate the compression ratios. After working for about 10 minutes, you can access a clue: 2D Map. After another 10 minutes, you can view the 2D Map with Terrain. There are many correct answers to this exercise.arrow_forward
- Need urgent help with Python Decorator creation Never used python decorator before Answer the following questions in the Python decorator context. Your answers should be written in a Markdown file. The quality of answers matters!! What is higher-order function and how it is different from functor? What are First-class objects? What is the significance of functions being First-class objects? What are inner functions? What is the major benefit of inner functions and why is it important for decorator Why @ symbol is called syntactic sugar? What's the biggest advantage of using it when decorators are used? How would it help Python's weak OOP encapsulation of Class? (Hint: google "Python @Property decorator")arrow_forwardThis is the program i have been given. I have to change it to meet the following criteria but can only change the body of the show_flashcard function # IMPORTANT# Q2 (a)(iii) Make changes only to# -- the docstring for the program as a whole.# -- the docstring of the show_flashcard() function# -- the body of the show_flashcard() function. def show_flashcard(): """ Show the user a random key and ask them to define it. Show the definition when the user presses return. """ random_key = choice(list(word_list)) print('Define: ', random_key) input('Press return to see the definition') print(word_list[random_key]) # Set up the word_list word_list = {'black':'noir', 'red':'rouge', 'yellow':'jaune', 'orange':'orange', 'white':'blanc', 'green':'vert'} # The interactive loop exit = Falsewhile not exit: user_input = input('Enter s to show a flashcard and q to quit: ') if user_input == 'q':…arrow_forwardUsing Python Spark Read each text files that are provided and convert each words in the file to lower case. (I cannot upload the text files so if you find a folder online with 15 text documents that would work) Create a list with words from each text files. Remove stop words from each list and get the final list of words for each text files. (The list of stop words are provided in stopwords.txt)arrow_forward
- Create a program in Python that asks the user to enter: - The names of 5 students and their corresponding quiz scores - The total of the quizzes will be calculated - The average of the quizzes will be calculated - Print a report of the quizzes which consists of output statements to print: - A comumn heading report (centered) - Student name and quiz column heading - All 5 of the student names and corresponding quizzes in two columns as shown on the next page: - The total of all the quizzes - An average of all the quizzesarrow_forwardmake own code related to writing and reading files in python . Save file as mukhammadali.py and take a picturearrow_forwarduse https://live.sympy.org/ (Links to an external site.) Review the examples about cardinality in Python using Sympy- https://www.geeksforgeeks.org/sympy-subset-cardinality-in-python/ (Links to an external site.) Explain each one, and what the result means Provide a link or a screenshot of working codearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education