Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2.9, Problem 29CP
Write a Python statement that defines a named constant for a 10 percent discount.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Please develop a Python application that meets the requirements described below:
Project Description:
Scenario:
Write a program for a retail store that will allow them to calculate discounts for their employees when they buy items.
Discounts are based on the number of years worked (2% for each year, maximum 10%) as well as if the employee is a manager (10% more discount on top of the worked year discount) or hourly employee (2% discount). They are also allowed no discount once they have received $200 discount.
The program starts asking for the employee discount number to start purchasing. The employee can purchase 1 item at a time. Do this until the user answers “NO” for “Another purchase?”.
Once all employees have been processed, display the All-Employee Summary and give the users option to go back to Menu or Exit the program.
A workflow diagram is provided for each function to help visualize the flow through the program.
Actions:
Menu Pages:
Create the menus below using a…
Please develop a Python application that meets the requirements described below:
Project Description:
Scenario:
Write a program for a retail store that will allow them to calculate discounts for their employees when they buy items.
Discounts are based on the number of years worked (2% for each year, maximum 10%) as well as if the employee is a manager (10% more discount on top of the worked year discount) or hourly employee (2% discount). They are also allowed no discount once they have received $200 discount.
The program starts asking for the employee discount number to start purchasing. The employee can purchase 1 item at a time. Do this until the user answers “NO” for “Another purchase?”.
Once all employees have been processed, display the All-Employee Summary and give the users option to go back to Menu or Exit the program.
A workflow diagram is provided for each function to help visualize the flow through the program.
Actions:
Menu Pages:
Create the menus below using a…
Answer must be in python 3 for beginners with step by step explanation please
Chapter 2 Solutions
Starting Out with Python (4th Edition)
Ch. 2.1 - Who is a programmers customer?Ch. 2.1 - What is a software requirement?Ch. 2.1 - What is an algorithm?Ch. 2.1 - What is pseudocode?Ch. 2.1 - Prob. 5CPCh. 2.1 - Prob. 6CPCh. 2.3 - Write a statement that displays your name.Ch. 2.3 - Write a statement that displays the following...Ch. 2.3 - Write a statement that displays the following...Ch. 2.5 - Prob. 10CP
Ch. 2.5 - Which of the following are illegal variable names...Ch. 2.5 - Prob. 12CPCh. 2.5 - Is the following assignment statement valid or...Ch. 2.5 - Prob. 14CPCh. 2.5 - Look at the following assignment statements:...Ch. 2.5 - What will be displayed by the following program?...Ch. 2.6 - You need the user of a program to enter a...Ch. 2.6 - Prob. 18CPCh. 2.7 - Prob. 19CPCh. 2.7 - Prob. 20CPCh. 2.7 - Prob. 21CPCh. 2.8 - How do you suppress the print functions ending...Ch. 2.8 - How can you change the character that is...Ch. 2.8 - Prob. 24CPCh. 2.8 - Prob. 25CPCh. 2.8 - What does the statement print (format (65.4321,...Ch. 2.8 - What does the statement print (format (987654.129,...Ch. 2.9 - What are three advantages of using named...Ch. 2.9 - Write a Python statement that defines a named...Ch. 2.10 - Prob. 30CPCh. 2.10 - Prob. 31CPCh. 2.10 - Prob. 32CPCh. 2.10 - Prob. 33CPCh. 2.10 - Prob. 34CPCh. 2.10 - Prob. 35CPCh. 2.10 - Prob. 36CPCh. 2.10 - Prob. 37CPCh. 2.10 - Prob. 38CPCh. 2.10 - Prob. 39CPCh. 2.10 - Prob. 40CPCh. 2.10 - Prob. 41CPCh. 2.10 - Prob. 42CPCh. 2.10 - Prob. 43CPCh. 2.10 - Prob. 44CPCh. 2.10 - Prob. 45CPCh. 2 - A ______ error does not prevent the program from...Ch. 2 - Prob. 2MCCh. 2 - A(n) __________ is a set of well-defined logical...Ch. 2 - An Informal language that has no syntax rules and...Ch. 2 - A _______ is a diagram that graphically depicts...Ch. 2 - A ______ is a sequence of characters. a. char...Ch. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - A string literal in Python must be enclosed in...Ch. 2 - Prob. 10MCCh. 2 - A(n) __________ makes a variable reference a value...Ch. 2 - This symbol marks the beginning of a comment in...Ch. 2 - Which of the following statements will cause an...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - This operator performs integer division. a. // b....Ch. 2 - This is an operator that raises a number to a...Ch. 2 - This operator performs division, but instead of...Ch. 2 - Prob. 18MCCh. 2 - Which built-in function can be used to read input...Ch. 2 - Prob. 20MCCh. 2 - A magic number is _______. a. a number that is...Ch. 2 - A _______ is a name that represents a value that...Ch. 2 - Programmers must be careful not to make syntax...Ch. 2 - In a math expression, multiplication and division...Ch. 2 - Variable names can have spaces in them.Ch. 2 - In Python, the first character of a variable name...Ch. 2 - If you print a variable that has not been assigned...Ch. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - If a math expression adds a float to an int, what...Ch. 2 - What is the difference between floating-point...Ch. 2 - What is a magic number? Why are magic numbers...Ch. 2 - Assume a program uses the named constant PI to...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Write a Python statement that assigns the sum of...Ch. 2 - Write a Python statement that subtracts the...Ch. 2 - Write a Python statement that multiplies the...Ch. 2 - Prob. 8AWCh. 2 - What would the following display? num = 99 num = 5...Ch. 2 - Assume the variable sales references a float...Ch. 2 - Assume the following statement has been executed:...Ch. 2 - What will the following statement display?...Ch. 2 - Write a turtle graphics statement that draws a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Sales Prediction A company has determined that its...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Distance Traveled Assuming there are no accidents...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Miles-per-Gallon A car's miles-per-gallon (MPG)...Ch. 2 - Tip, Tax, and Total Write a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Write...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Transaction Program Last month, Joe...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...Ch. 2 - Turtle Graphics Drawings Use the turtle graphics...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Describe the common components needed to create a Web-based application.
Modern Database Management
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Write a line of Java code that will give the name ANSWER to the int value 42. In other words, make answer a nam...
Absolute Java (6th Edition)
Look at the following class declarations and answer the questions that follow them: public class Shape { privat...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Identify and briefly describe four types of requirements that may be defined for a computer- based system.
Software Engineering (10th Edition)
Speedcoding was invented to overcome two significant shortcomings of the computer hardware of the early 1950s. ...
Concepts Of Programming Languages
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
- Write a program in Python that reads the following information and prints a payroll statement: Employee’s name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 9.75) Federal tax withholding rate (e.g., 20%) State tax withholding rate (e.g., 9%) A sample run is shown below: Enter employee's name: Smith Enter number of hours worked in a week: 10 Enter hourly pay rate: 9.75 Enter federal tax withholding rate: 0.20 Enter state tax withholding rate: 0.09 Employee Name: Smith Hours Worked: 10.0 Pay Rate: $9.75 Gross Pay: $97.5 Deductions: Federal Withholding (20.0%): $19.5 State Withholding (9.0%): $8.77 Total Deduction: $28.27 Net Pay: $69.22arrow_forwardUSING C++ PROGRAMMING LANGUAGE A mobile phone service has three different data plans for its customers: PLAN A: For $19.99 per month, 2 gigabytes are provided. Additional usage costs $8.00 per gigabyte. PLAN B: For $59.99 per month, 8 gigabytes are provided. Additional usage costs $8.00 per gigabyte. PLAN C: For $79.99 per month, Unlimited data is provided. Write a program that calculates a customer’s monthly bill. It should input the customer name, which plan was purchased, and how many gigabytes were used. It should then create a bill that includes the input information and the total amount due. It should also display how much money plan A customers would save if they purchased plan B or C, and how much money plan B customers would save if they purchased plan C. If there would be no savings, no message should be printed. Wherever possible, use named constants instead of numbers.arrow_forwardPython Programming Part: Carbon-14 is constantly produced in Earth's upper atmosphere due to interaction between cosmic rays and nitrogen, and is found in all plants and animals. After a plant or animal died, its amount of carbon-14 decreases by about 0.012% per year. Write a python code to determine the half-life of carbon-14, that is, the number of years required for 1 gram of carbon-14 to decay to less than 1/2 gram. Example Output: Carbon-14 has a half-life of years. >>>arrow_forward
- In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00 NOTE: The first column is left-justified, and the right column is…arrow_forwardIn C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: Federal Tax: State Tax: Pension Plan: . Health Insurance: $3575.00 Social Security Tax: Medicare/Medicaid Tax:.........$ 98.31 Net Pay:...... $ 536.25 $ 125.13 $ 205.56 $ 178.75 $ 75.00 $2356.00arrow_forwardPLEASE ANSWER IN C#: Suppose you want to deposit a certain amount of money into a savings account and then leave it alone to draw interest for the next 10 years. At the end of 10 years you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? You can use the following formula: P =F/(1 + r)n The terms in the formula are as follows:• P is the present value, or the amount that you need to deposit today.• F is the future value that you want in the account. (In this case, F is $10,000.)• r is the annual interest rate.• n is the number of years that you plan to let the money sit in the account. Write a method named PresentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the method in an application that lets the user experiment with different values for…arrow_forward
- please use c++ to answer the following questionarrow_forwardC++ with multiple functions if possible Write a program to simulate an automated teller machine (ATM) at a bank. The program should ask the user for a four-digit personal identification number (PIN) to verify they are supposed to have access to the account. If they enter the PIN incorrectly, they should be denied access to the account, but the program should automatically ask them to enter the PIN again. It is up to you to decide if you want to give a maximum number of tries before exiting. The ATM program should ask the user for a beginning balance, and then provide the user with the opportunity to enter deposits and withdrawals until the user wishes to exit the program. Upon exiting the program, it needs to display the current balance.arrow_forwardScenario:USING C# You are tasked with writing a program to process students’end of semester marks. For each student you must enter into your program the student’s id number (an integer), followed by their mark (an integer out of 100) in 4 courses. A student number of 0 indicates the end of the data. A student moves on to the next semester if the average of their 4 courses is at least 60 (greater than or equal to 60). Write a program to read the data and print, for each student: The student number, the marks obtained in each course, final mark of the student (average of all the marks), their final grade (A,B,C,D or F) and whether or not they move on to the next semester. In addition, after all data entry is completed, print The number of students who move on to the next semester and the number who do not. The student with the highest final mark (ignore the possibility of a tie). Grades are calculated as follows: A = 70 and over, B = 60 (inclusive) -70, C = 50(inclusive)-60…arrow_forward
- True/False 5. In Python, some parameters are passed by referencearrow_forwardThe programming language is C++, write a program base on the given statement. In 2001, Bureau of Internal Revenue proposed an overhaul of theIncome Tax Law. They proposed the ff. schedule: INCOME TAX RATE0 to 5000 0 5001 to 10000 100 + 3% of income over 5000 10001 to 25000 200 + 6% of income over 10000 25001 to 50000 300 + 9% of income over 25000 Over 50000 500 + 15% of income over 50000arrow_forwardCreate a c++ program that asks an employee the following questions: Employee name Employee ID Employee department Number of absences in a month Number of late in a month Let's say that an average employee needs to have 24 days of no late and no absent attendance in a month to earn his/her full salary of 24,000 1 late = 200 pesos deduction 1 absent = 1000 pesos deduction The program would then compute the total salary of the employee based from the information that he/she entered Example output: Please enter your name: Gerard Bautista Please enter your Department: IT Please enter number of lates: 3 Please enter number of absences: 2 Output: Gerard Bautista from IT department has an equivalent of 3 lates and 2 absences. His total earning for the month is 21400.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY