Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 25RQE
Little Italy Pizza charges $14.95 for a 12-inch diameter cheese pizza and $17 .95 for a 14-inch diameter cheese pizza. Write the pseudocode for an
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Collatz Sequence: In 1937, Lothar Collatz proposed that no matter what number you begin with, the
sequence eventually reaches 1. This is widely believed to be true but has never been formally proved.
Write a program that inputs a number from the user, and then displays the Collatz Sequence starting
from that number. Stop when you reach 1.
If n is even, divide it by 2 to get n / 2.
If n is odd, multiply it by 3 and add 1 to get 3n + 1.
Repeat the process indefinitely.
Find out and print the maximum number that you can get in these calculations. '
Part-3:
Please enter a number: 2051
6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70
35 106 53 160 80 40 20 10 5 16 8 4 2 1
The maximum number you get: 9232
A retail company assigns a $5000 store bonus if monthly sales are more than $100,000; otherwise a $500 store bonus is awarded. Additionally, they are doing away with the previous day off program and now using a percent of sales increase to determine if employees get individual bonuses. If sales increased by at least 4% then all employees get a $50 bonus. If they do not, then individual bonuses are 0.
Step 7: The final step in completing the pseudocode is to call all the modules with the proper arguments. Complete the missing lines.
Module main ()
//Declare local variables
Declare Real monthlySales
Declare Real storeAmount
Declare Real empAmount
Declare Real salesIncrease
//Function calls
Call getSales(monthlySales)
Call getIncrease(salesIncrease)
Call ______________(_______________, _____________)
Call ______________(_______________, _____________)
Call ______________(_______________, _____________)
End Module
The concentration (C) of insulin in the body is described by the following equation
C = C0e^-40t / M
Where
C0 = 85 pmol/L is the initial insulin concentration, t is time in minutes, M is the person
mass in kg.
a) Write code that will calculate the insulin concentration of two people with weighs 60
Kg and 100 Kg. Simulate the insulin concentration for 4 minutes in steps of 0.1
minute.
b) Plot the insulin concentration of the two people on the same graph. For the first
curve plot a magenta solid line, square marker, cyan for MarkerFaceColor, and
MarkerSize of 6. For the second curve plot a black dashed line with LineWidth of 2.
c) Your plot should have a title, a legend, and appropriate labels for the x and y axis.
Chapter 3 Solutions
Starting Out With C++: Early Objects (10th Edition)
Ch. 3.1 - Prob. 3.1CPCh. 3.1 - What is the symbol called?Ch. 3.1 - Where does cin read its input from?Ch. 3.1 - Prob. 3.4CPCh. 3.1 - Assume value is an integer variable. If the user...Ch. 3.1 - A program has the following variable definitions....Ch. 3.1 - The following program will run, but the user will...Ch. 3.1 - Complete the following main function so that it...Ch. 3.2 - In each of the following cases, tell which...Ch. 3.2 - Complete the following table by writing the value...
Ch. 3.2 - Prob. 3.11CPCh. 3.2 - Study the following program code and then complete...Ch. 3.2 - Complete the following program skeleton so that it...Ch. 3.3 - Assume the following variable definitions: int a =...Ch. 3.3 - What will the following program code display if a...Ch. 3.3 - What will the following program code display? int...Ch. 3.5 - Prob. 3.17CPCh. 3.5 - Complete the following program code segment so...Ch. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - What will the following program segment display?...Ch. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - The following program segment converts an angle in...Ch. 3.8 - Will the following string literal fit in the space...Ch. 3.8 - If a program contains the definition string name;...Ch. 3.8 - Prob. 3.26CPCh. 3.10 - Use a mathematical library function with a cout...Ch. 3.10 - Assume the variables angle1 and angle2 hold angles...Ch. 3.10 - To find the cube root (the third root) of a...Ch. 3.10 - Write a statement that produces a random number...Ch. 3 - Prob. 1RQECh. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Assume the following variables are defined: int...Ch. 3 - What header files must be included in the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Prob. 11RQECh. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a pair of multiple assignment statements...Ch. 3 - Is the following code legal? Why or why not? const...Ch. 3 - Write a cout statement that uses stream...Ch. 3 - Write a cout statement that uses stream...Ch. 3 - What header file must be included A) to perform...Ch. 3 - Pet World offers a 15 percent discount to senior...Ch. 3 - A bowling alley is offering a prize to the bowler...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Little Italy Pizza charges 14.95 for a 12-inch...Ch. 3 - A) (Assume the user enters George Washington.)...Ch. 3 - Each of the following program segments has some...Ch. 3 - A) const int number1, number2, product; cout ...Ch. 3 - Soft Skills Often programmers work in teams with...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three searing categories...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Male and Female Percentages Write a program that...Ch. 3 - Vacation Days Write a program that prompts the...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How many Calories? A bag of cookies holds 30...Ch. 3 - Ingredients Adjuster A cookie recipe calls for the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Monthly Sales Tax A retail company muse file a...Ch. 3 - Property Tax Madison County collects property...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Slices Joe's Pizza Palace needs a program to...Ch. 3 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What populates the Smalltalk world?
Concepts Of Programming Languages
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
What is a well-encapsulated class definition?
Java: An Introduction to Problem Solving and Programming (7th Edition)
Declare an enumerated data type named Direction with enumerators for North, South, East, and West.
Starting out with Visual C# (4th Edition)
Practice Problem 8.5 (solution page 797) Write a wrapper function for sleep, called snooze, with the following ...
Computer Systems: A Programmer's Perspective (3rd Edition)
A list is a collection that _____. a. associates keys with elements b. assigns an index to each of its elements...
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
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
- Explain every step pleasearrow_forwardParty-On sells individual hot/cold cups and dessert plates for parties. SueChen wants a program that allows her to enter the price of a cup, the price of a plate, the number of cups purchased, and the number of plates purchased. The program should then calculate the total cost of the purchase, including the sales tax. Finally, the program should display the total cost on the screen. Desk-check your solution’s algorithm using $0.50 as the cup price, $1 as the plate price, 35 as the number of cups, 35 as the number of plates, and 2% as the tax rate. Then desk-check it using $0.25, $0.75, 20, 10, and 6%.arrow_forwardThe concentration (C) of insulin in the body is described by the following equationC = C0e^-40t / MWhereC0 = 85 pmol/L is the initial insulin concentration, t is time in minutes, M is the personmass in kg.a) Write code that will calculate the insulin concentration of two people with weighs 60Kg and 100 Kg. Simulate the insulin concentration for 4 minutes in steps of 0.1minute.b) Plot the insulin concentration of the two people on the same graph. For the firstcurve plot a magenta solid line, square marker, cyan for MarkerFaceColor, andMarkerSize of 6. For the second curve plot a black dashed line with LineWidth of 2.c) Your plot should have a title, a legend, and appropriate labels for the x and y axis.arrow_forward
- Body Mass Index is a simple calculation using a person's height and weight. The formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in meters squared. Calculate a persons Body Mass index using their weight in pounds. This means you must first convert pounds to kilograms (kg) then apply the formula above. In converting pounds to kg, 1 pound = 0.453592 kg. So to convert pounds to kg, either multiply the pound value by 0.45359237 or divide by 2.2046226218. Then you must convert their height in inches to meters. The length in meters is equal to the inches multiplied by 0.0254. Write a program that accepts a users height as an integer in inches and their weight in pounds. Convert those inputs to their metric equivalents outlined above and determine their body mass index. Display what the conversions from and to their metric equivalents are. Display the body mass index and the category it belongs to.arrow_forwardi need the answer quicklyarrow_forwardCredit Card Number CheckThe last digit of a credit card number is the check digitwhich protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16: Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is 4358 9795, then you form the sum 5 + 7 + 8 + 3 = 23 . Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers . For example, with the number given above, doubling the digits. starting with the next-to-last one, yields 18 18 10 8. Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 Add the sums of the two preceding steps . If the last digit of the result is 0, the number is valid . In our case , 23 + 27 = 50 , so the number is valid . Write a program that implements this…arrow_forward
- Box Office: A movie theater only keeps a percentage (20%) of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program that calculates a theater’s gross and net box office profit for a night. The program should ask for the name of the movie, and how many adult and child tickets were sold. (The price of an adult ticket is $10.00 and a child’s ticket is $6.00.) Input: the name of the movie, number of adult tickets sold, number of child tickets sold Output: as specified below Object: cin, cout, getline, format output Note: 1. Movie names contain spaces 2, the report is aligned. 3. The decimal number is displayed with 2 decimal places.arrow_forwardExercise II Write a program that finds the positive integer solutions of the following equation ax³ + bx² + cx' + d = 0. The user enters the values of coefficients a, b, c and d. The program should test each integer starting from -50 to 50, and each time the equation is equal to zero, it prints its value as well as "is a solution". At the end, it displays the total number of positive integers found. Note that if the equation has more than one solution, the plural word “solutions" is used in the output. Sample run 1: Enter the coefficient of a, b, c, d: 1 -8.5 21 -13.5 1 is a solution 3 is a solution The equation has 2 integers as solutions Sample run 2: Enter the coefficient of a, b, c, d: 6 48 103.5 67.5 The equation has no integer solutions Sample run 3: Enter the coefficient of a, b, c, d: 1 -1 -12 0 4 is a solution The equation has 1 integer solutionarrow_forward,arrow_forward
- Microwaves / Radio Waves If a scientist knows the wavelength of an electromagnetic wave she can determine what type of radiation it is. Write a program that asks for the wavelength in meters of an electromagnetic wave and then displays what that wave is according to the following chart. (For example, a wave with a wavelength of 1E-10 meters would be an X-ray.) 1x 10-11 1 x 10-8 4 x 10-7 7x 10-7 1x 10-3 1 x 10-2 Gamma Rays. X Rays Ultraviolet Visible Light Infraredarrow_forwardSuppose that your electric company charges you once per year for the electricity you use. Suppose the electric company charges you $0.06 per kilowatt-hour for the first 1000 kilowatt hours you use and $0.08 per kilowatt-hour for all kilowatt-hours more than 1000 that you use. Write an algorithm that loops to ask the user to enter the number of kilowatt-hours used for each of the last 12 months, computes and prints the amount to be charged that month, and afterwards prints the total amount to be charged for 12 months worth of electric usage.arrow_forwardWrite the pseudocode that will produce a slip similar to the one illustrated atthe beginning of the question. Your solution should satisfy the followingrequirements: The solution must illustrate the use of good programming practices; The solution must make use of a loop; The loop must make use of a sentinel value.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY