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
Concept explainers
Question
Computer Science
Write correct Python code to complete the following task. Document all assumptions. Solutions that do not incorporate a loop will receive a grade of 0.
Obtain a positive integer greater than 1 but less than 20 from the user. Calculate the product of all numbers starting from the user's number up to, and including 100. If the number is evenly divisible by 7, do not include it in the product. If the product is more than or equal to 5000 stop the loop early and show the message "a big product". When the loop ends, if the product is less than 5000 show the product to the user.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images
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
- Looping Construct with Floating Point Numbers Write a program that utilizes a while-loop to read a set of five floating-point values from user input. Include code to prevent an endless loop. Ask the user to enter the values, then print the following data: Total Average Maximum Minimum Interest on total at 20% Answer:arrow_forwardDesign a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the user to enter each of their expenses for the month, and keep a running total. When the loop finishes, the program should display the amount that the user is over budget. Please provide answer in Pseudocode as well as python language. Please write line numbers before each line of the algorithm, include blank numbered lines between modules and write comments. Here are some parameters to solve the problem. a. Your Main module should declare two local variables and call three other modules.b. Create a module to get the amount budgeted for the month from the software user. c. Create a module that uses a loop to ask the software user for the price of each item purchased that month. The loop should stop when the software user does not reply with a lower case y to continue entering prices. make sure this loop has two lines.The loop should also contain an accumulator…arrow_forwardpython onlystart from here: def ask_for_age(): age = int(input('Enter the age of a family member: ')) return agearrow_forward
- Program - python Ask the user to enter a number, and print the number out to the 2nd decimal place. For example, if they enter 10.686666666, your program will print 10.69.arrow_forwardUse Flowgorithm for the following:arrow_forwardDesign a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period. Modularize the program. Present clear formatted code with comments. I need this coded in pseudocode, please.arrow_forward
- Week runners log Coding in Python and mainly using loops create a program base on the following; Mike, Tina, Jason, Vicky, and Tammy are preparing for an upcoming marathon. Each day of the week, they run a certain number of miles and write them into a notebook. At the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day, Write a program to help them analyze their data. Your program should create a two-dimensional list of five rows and seven columns to store the number of miles run by each runner each day. Sample Output Name Day 1 Day 2 Day 3 Day 4 Day 5 Day 6 Day 7 Average =============================================Mike 10.00 15.00 20.00 25.00 18.00 20.00 26.00 19.14Tina 15.00 18.00 29.00 16.00 26.00 20.00 23.00 21.00Jason 20.00 26.00 18.00 29.00 10.00 12.00 20.00 19.29Vicky 17.00 20.00 15.00 26.00 18.00…arrow_forwardTransient PopulationPopulations are affected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. Write a program that displays the size of a population for any number of years. The program should ask for the following data: The starting size of a population P The annual birth rate (as a percentage of the population expressed as a fraction in decimal form)B The annual death rate (as a percentage of the population expressed as a fraction in decimal form)D The average annual number of people who have arrived A The average annual number of people who have moved away M The number of years to display nYears Write a function that calculates the size of the population after a year. To calculate the new population after one year, this function should use the formulaN = P + BP - DP + A - Mwhere N is the…arrow_forward
arrow_back_ios
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
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education