Starting Out with Python (3rd Edition)
3rd Edition
ISBN: 9780133582734
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
thumb_up100%
Chapter 3, Problem 5AW
Write nested decision structures that perform the following: If amount1 is greater than 10 and amount 2 is less than 100, display the greater of amount1 and amount2.
Expert Solution & Answer
Trending nowThis is a popular solution!
Learn your wayIncludes step-by-step video
schedule03:11
Students have asked these similar questions
Transcribed Image Text
Write a program that asks for the principal, the annual interest rate, and the number of times the interest is compounded. It should display a report similar to the following: Interest Rate: 4.25% Times Compounded: 12 Principal: $ 1000.00 Interest: 43.33 Final balance: $ 1043.33
software.cpp
A software company sells a package that retails for $99. Quantity discounts are given according to the following
table.
Quantity
10-19
20-49
50-99
100 or more
Discount
20%
30%
40%
50%
Write a program that asks for teday's date (you MUST use cin >> date. Do not use getline(cin, date), the
company name and the quantity'they wish to buy and computes the total cost of the purchase. If the user enters a
negative value for the quantity, tell him/her "invalid quantity". If a zero is entered, tell "Hope you decide to buy
our software in the future." Otherwise display an invoice in the same format shown below.
Your prompts and outputs have to look exactly the same as the following sample
run (spacing too). I used 30 spaces for the labels and 10 spaces for the numbers.
[kslotteempress cs111_lec_fall16]s ./a.out
Enter today's date (mm/dd/yy): 09/27/16
Enter your company name: Little Coffee Shop
Enter the quantity you would like to purchase: 10
Invoice for Little Coffee Shop
Price…
1- You are required to draw flow chart and write a Pseudocode for the following problem statement.
Muscat MobiCare is a Mobile Outlet, which provides Mobile repair services. The charges of mobile repairs are based on the type of the service.
Details of charges are as follow:
Software Fault: 4 OMR
Screen Fault: 6 OMR
Network/Wi-Fi Fault: 8 OMR
Internal Hardware Fault: 10 OMR
The Outlet offers discount to the loyal customers. The discount is offered based on the customer visits to the outlet.
Following is the detail of discounts.
1- Customer visiting 4 times a year gets 20% discount.
2- Customer visiting 6 times a year gets 30% discount.
3- Customer visiting 8 times a year gets 50% discount.
You are required to draw a Flow Chart diagram and write a Pseudocode for a computer program that takes customer name, mobile model, visit date, total number of visits, and required service (mentioned above). The program outputs a receipt with all the entered information plus repair charges based on…
Chapter 3 Solutions
Starting Out with Python (3rd Edition)
Ch. 3.1 - What is a control structure?Ch. 3.1 - What is a decision structure?Ch. 3.1 - Prob. 3CPCh. 3.1 - Prob. 4CPCh. 3.1 - What types of relationships between values can you...Ch. 3.1 - Write an if statement that assigns 0 to x if y is...Ch. 3.1 - Write an if statement that assigns 0.2 to...Ch. 3.2 - Prob. 8CPCh. 3.2 - What statement do you use in Python to write a...Ch. 3.2 - When you write an if-else statement, under what...
Ch. 3.3 - What would the following code display? If 'z a:...Ch. 3.3 - What would the following code display? s1 = 'New...Ch. 3.4 - Convert the following code to an if-elif-else...Ch. 3.5 - Prob. 14CPCh. 3.5 - Prob. 15CPCh. 3.5 - Assume the variables a = 2, b = 4, and c = 6....Ch. 3.5 - Explain how short-circuit evaluation works with...Ch. 3.5 - Write an if statement that displays the message...Ch. 3.5 - Write an if statement that displays the message...Ch. 3.6 - Prob. 20CPCh. 3.6 - What is a flag variable?Ch. 3 - A ______ structure can execute a set of statements...Ch. 3 - A __________ structure provides one alternative...Ch. 3 - A(n) _________ expression has a value of either...Ch. 3 - The symbols , , and == are all ___________...Ch. 3 - A(n)__________ structure tests a condition and...Ch. 3 - You use a(n) _______ statement to write a single...Ch. 3 - You use a(n) ______ statement to write a dual...Ch. 3 - and, or, and not are ________ operators. a....Ch. 3 - A compound Boolean expression created with the...Ch. 3 - A compound Boolean expression created with the...Ch. 3 - The _________ operator takes a Boolean expression...Ch. 3 - A ________ is a Boolean variable that signals when...Ch. 3 - Prob. 1TFCh. 3 - A program can be made of only one type of control...Ch. 3 - A single alternative decision structure tests a...Ch. 3 - A decision structure can be nested inside another...Ch. 3 - A compound Boolean expression created with the and...Ch. 3 - Explain what is meant by the term conditionally...Ch. 3 - You need to test a condition then execute one set...Ch. 3 - Briefly describe how the and operator works.Ch. 3 - Briefly describe how the or operator works.Ch. 3 - Prob. 5SACh. 3 - What is a flag and how does it work?Ch. 3 - Write an if statement that assigns 20 to the...Ch. 3 - Write an if statement that assigns 0 to the...Ch. 3 - Write an if-else statement that assigns 0 to the...Ch. 3 - The following code contains several nested if-else...Ch. 3 - Write nested decision structures that perform the...Ch. 3 - Write an if-else statement that displays 'speed is...Ch. 3 - Write an if-else statement that determines whether...Ch. 3 - Day of the Week Write a program that asks the user...Ch. 3 - Areas of Rectangles The area of a rectangle is the...Ch. 3 - Age Classifier Write a program that asks the user...Ch. 3 - Roman Numerals Write a program that prompts the...Ch. 3 - Mass and Weight Scientists measure an objects mass...Ch. 3 - Magic Dates The date June 10, 1960, is special...Ch. 3 - Color Mixer The colors red, blue, and yellow are...Ch. 3 - Hot Dog Cookout Calculator Assume hot dogs come in...Ch. 3 - Roulette Wheel Colors On a roulette wheel, the...Ch. 3 - Money Counting Game Create a change-counting game...Ch. 3 - Book Club Points Serendipity Booksellers has a...Ch. 3 - Software Sales A software company sells a package...Ch. 3 - Shipping Charges The Fast Freight Shipping Company...Ch. 3 - Body Mass Index Write a program that calculates...Ch. 3 - Time Calculator Write a program that asks the user...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
The following code transposes the elements of an M M array, where M is a constant defined by #define. When com...
Computer Systems: A Programmer's Perspective (3rd Edition)
Suppose you have two function definitions with the function declarations given in Self-Test Exercise 25. Which ...
Problem Solving with C++ (10th Edition)
What Ada construct provides support for abstract data types?
Concepts of Programming Languages (11th Edition)
Describe the implementation of the method drawHere for a class called Diamond that is derived from the class Sh...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Why is the study of database technology important?
Database Concepts (7th Edition)
State whether each of the following is true or false. If false, explain why. All expression containing the | | ...
Java How To Program (Early Objects)
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
- Q1 part d need code in c++ in visual studio the quotient after q is divided by divisor and assign the result to q. Write this statement in two different ways.arrow_forwardThe company discounted used cars pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary.Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month. algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salaryarrow_forwardHome Buffet is trying to make a comeback. They want to offer special prices to the seniors an children to eat at their Buffet. Create a flow chart that meets the following requirements: Read age if age is 50 or more, display: "Welcome Senior, you get 80% discount" if age is 10 or less, display: "Welcome Young adult, you eat for FREE!" if age is between 11 and 49 display: "The price for your lunch is $8" Note: Use draw.io Links to an external site.to create the flowchartarrow_forward
- Software SalesA software company sells a package that retails for $99. Quantity discounts are given accordingto the following table:Quantity Discount10–19 10%20–49 20%50–99 30%100 or more 40%Write a program that asks the user to enter the number of packages purchased. The programshould then display he number of packages purchased, the amount of the discount (if any) and the total amount of the purchase after the discount.arrow_forwardLecture Note Form : F = ±(0.d₁d2d3... dm) ße, Normalized Form : F= ±(1.d₁d2d3 ... dm) B Be Denormalized Form : F= ±(0.1d₁d2d3 ·dm) 3 ße ... Let ß = 2, m = 4, emin = -1 and emax = 2. Answer the following questions: (a) Compute the minimum of r for normalized form. (b) Compute the Machine Epsilon value for the normalized form. Compute the maximum delta value for the form given in Eq. (1). (c) .(i) .(ii) .(iii)arrow_forwardTrue or False 5. The name gross_pay is written in the camelCase convention.arrow_forward
- A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; prod- uct 3, $9.98; product 4, $4.49 and product 5, $6.87. Write an application that reads a series of pairs of numbers as follows: a) product number b) quantity sold Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the pro- gram should stop looping and display the final results.arrow_forwardRemaining Time: 54 minutes, 49 seconds. * Question Completion Status: QUESTION 19 Write a Java program that prompts the user to enter the School Grade Level of a student and then calculate their discount amount in the regular fees structure offered during this pandemic situation. By using the below table, calculate their discount amount from the amount of the regular fee and then print the discount amount in OMR by using the appropriate selection structure. (Assume the user is entering a maximum Grade level is 12) discount amount = Regular Fees * percentage of discount rate School Grade Level Regular Fees in OMR Discount Rate >9 and 6 and 3 and 0 and <=3 30.500 5% otherwise 20.400 No discount T T T Arial 3 (12pt) v T -E E- 只i ン Click Save and Submit to save and submit. Click Save All Answers to save all answers. Save All Answers TOSHIBA F5 F6 F7 F8 F9 F10 F11 F12 INS SCNULL LOCK AD & 67 7 V 8A9 4 0arrow_forwardSlappy’s Software Sales AssignmentYou have been hired by Slappy’s Software Sales to write a program to figure thetotal cost to customers that order Slappy’s software packages.Discounts are given based on the number of units sold:Number of Units Sold Discount Amount1 – 9 None10 – 19 20%20 – 49 30%50 – 99 40%100 or more 50%Create a form similar to this:The three boxes are labels. Remember to use the Auto Size and Border Styleproperties.The program should read the number of units sold and figure a base cost. Theunits cost $99 each. A discount should then be figured and subtracted from thebase cost. The subtotal, discount amount and total cost should be displayed, ascurrency, in the appropriate labels.Here are some screen shots of the running program:Set the tab order and access keys.Put comments in your program as to what each section is doing.Use constants for the discount rates and base price.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY