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
write a Python program that operates like a cashier .prompt for the number of different items being purchased and then start a loop. in the loop the program should prompt for the item description price and quantity of each item being purchased these three values should be passed as arguments to a custom function
that is to find in a separate module file the imported function should print the subtotal for the item and return it to main the total should be printed in Main after the loop ends
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 4 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
- Use matlab to determine the answer. Use the function file then call the function to get the answer in a script file.arrow_forwardUsing Pythonarrow_forwardDefine a function named check in Python that takes a variable as a parameter and returns true if that parameter is either an integer or a string, otherwise, it returns false.arrow_forward
- Define a function named get_pattern_number() which promps the user to input an integer which is between 0 and 8 (inclusive). If the user enters an invalid value, the function continues to prompt the user to enter the number (using a while loop) until the number entered is valid. The function returns the valid number. For example: Test Input Result print (get_pattern_number()) 50 Enter a number (0-8): 50 Enter a number (0-8): 25 25 -12 Enter a number (0-8): -12 Enter a number (0-8): -1 -1 9 Enter a number (0-8): 9 2 Enter a number (0-8): 2 2 Enter a number (0-8): 8 value = get_pattern_number() 8 print (value) 8 print (type(value))arrow_forwardwrite a program that operates like a cashier terminal in a grocery store it begins by prompting for the number of different items being purchased and then starts a loop in the loop the program should prompt for the item description price and quantity of each item being purchased these three values should be passed as arguments to a custom function that is to find in a separate module file the imported function should print the subtotal for the item and return it to main the total should be printed in Main after the loop endsarrow_forwardAgain, modify the while loop to utilize tolower() or toupper(). Create two more functions (options #3 and #4 in your menu) by taking the to_kilograms() and to_pounds() functions and modifying them to use reference variables instead of normal pass by value variables. Name them: to_kilograms_ref() to_pounds_ref() Create another two functions (options #5 and #6 in your menu) by taking the to_kilograms() and to_pounds() functions and modifying them to use pointers instead of normal pass by value variables. Name them: to_kilograms_ptr() to_pounds_ptr() Your new Menu should look like this, which includes what type of variables are being used: MENU 1. Kilograms to Pounds (pass by value) 2. Pounds to Kilograms (pass by value) 3. Kilograms to Pounds (pass by reference) 4. Pounds to Kilograms (pass by reference) 5. Kilograms to Pounds (using pointers) 6. Pounds to Kilograms (using pointers) Example: #include <iostream> #include <cmath>…arrow_forward
- use c++ programing language. Read two integer number from an input file called input.txt, then add these two numbers , store it in a variable called TOTAL, find the difference of the two numbers , store it in Difference, find product to the two numbers , store it in a variable called Multiply, fine quotient of the two number call it Division, find modular division of them and store it in a variable called MUD.arrow_forwardDesign a modular program in Python to process payroll for all hourly paid employees, save all the data into a text file and make a backup file as well. The program should allow user enter each employee's ID, name, hours worked, and hourly pay rate. And then calculate gross pay with overtime hours(hours beyond 40) paid 50% more. And then the program should display pay statement for each employee and store them into a same text file. The program should display total number of employees, total number of hours worked by all employees, and total gross pay and save them at the end of the same text file as well. The program should contain the following functions: main(), get_employee_info(), calc_gross_pay(hours, rate), display_pay_statement(emp_id, emp_name, hours_horked, hourly_pay_rate, gross_pay), save_pay_statement_to_file(file_object, emp_id, emp_name, hours_worked, hourly_pay_rate, gross_pay), save_summary_to_file(file_object, number_of_employees, total_hours_worked, total_gross_pay).…arrow_forwardHow can I write a python program with a main function that imports a custom module file. The custom module file defines a function that takes the radius of a circle as its only parameter. In the module's custom function: calculate the area and circumference of the circle and use an f-string to print one precisely formatted line as follows: the radius should display centered with one decimal place in a column 8-characters wide. the area should be centered with four decimals in a column 12-characters wide. the circumference should also be centered with four decimals in a column 12-characters wide. outputs in the thousands should display commas. In the main function: print headings for the columns with the same alignments and widths. run a loop that will go through seven iterations. inside the loop generate a random integer from 40-80, inclusive. execute the function in the custom module with the random integer as its argument.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