C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 1.4, Problem 6E
(Numerical) a. Write a set of detailed, step-by-step instructions in English to calculate the fewest number of dollar bills needed to pay a bill of amount TOTAL. For example, if TOTAL is $97, the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (For this exercise, assume that only $100, $50, $20, $10, $5, and $1 bills are available.)
b. Repeat Exercise 6a, but assume the bill is to be paid only in $1 bills.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(Use Python)
The function course_average should calculate and return the average of the three values pass to it.
The function main should ask the user to enter three grades and then pass these values to the course_average function. This function should also display a message to the user in the format below.
For example, if the user entered 100, 90 and 95 the message would be:The average of 100 , 90 and 95 is 95
((Simulation: The Tortoise and the Hare) In this problem, you’ll re-create one of the truly great moments in history, namely the classic race of the tortoise and the hare. You’ll use random number generation to develop a simulation of this memorable event.
Our contenders begin the race at square 1 of 70 squares. Each square represents a possible position along the race course. The finish line is at square 70. The first contender to reach or pass square 70 is rewarded with a pail of fresh carrots and lettuce. The course weaves its way up the side of a slippery mountain, so occasionally the contenders lose ground.
Use variables to keep track of the positions of the animals (i.e., position numbers are 1–70). Start each animal at position 1 (i.e., the “starting gate”). If an animal slips left before square 1, move the animal back to square 1.
Generate the percentages in Fig. 10.24 by producing a random integer i in the range 1 ≤i ≤10. For the tortoise, perform a “fast plod” when 1 ≤i…
(a) Using the program above, Compute a monthly tax (in Namibian Dollars) payableby an individual earning N$980, 953 per annum, with a tax free monthly allowanceof N$15, 000. NB: Your answer to this question should be presented as a commentat the end of the main code, with all details.
Chapter 1 Solutions
C++ for Engineers and Scientists
Ch. 1.1 - (Practice) a. To convert inches (in) to feet (ft),...Ch. 1.1 - (Conversion) Blood pressure is the force of blood...Ch. 1.1 - Prob. 3ECh. 1.1 - Prob. 4ECh. 1.1 - (Practice) a. Determine the conversion factors...Ch. 1.1 - Prob. 6ECh. 1.1 - (Automotive) a. An automobile engine’s performance...Ch. 1.1 - (Chemistry) a. Determine the final units of the...Ch. 1.1 - (Oceanography) The pressure, P, exerted on an...Ch. 1.1 - (Thermodynamics) The work, W, performed by a...
Ch. 1.2 - (Practice) Convert the following numbers from...Ch. 1.2 - Prob. 2ECh. 1.2 - Prob. 3ECh. 1.2 - Prob. 4ECh. 1.2 - Prob. 5ECh. 1.2 - Prob. 6ECh. 1.2 - Prob. 7ECh. 1.3 - (Electrical eng.) You’ve been asked to write a C++...Ch. 1.3 - (Physics) You’ve been asked to write a program to...Ch. 1.3 - (Electrical eng.) You’ve been asked to write a...Ch. 1.3 - Prob. 4ECh. 1.3 - (General math) Consider the following programming...Ch. 1.3 - Prob. 6ECh. 1.3 - (Statistics) This is the formula for the standard...Ch. 1.3 - Prob. 8ECh. 1.4 - (Practice) Determine a step-by-step procedure...Ch. 1.4 - Prob. 2ECh. 1.4 - Prob. 3ECh. 1.4 - Prob. 4ECh. 1.4 - Prob. 5ECh. 1.4 - (Numerical) a. Write a set of detailed,...Ch. 1.4 - (Data processing) a. Write an algorithm to locate...Ch. 1.4 - (Data processing) Determine and write an algorithm...Ch. 1.4 - (Numerical) Determine and write an algorithm to...Ch. 1 - (Conversion) Determine which of the following...Ch. 1 - (Conversion) An object’s polar moment of inertia,...Ch. 1 - Prob. 3PPCh. 1 - Prob. 4PPCh. 1 - Prob. 5PPCh. 1 - Prob. 6PPCh. 1 - Prob. 7PPCh. 1 - Prob. 8PP
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
- Problem 1: (Hint: Use a sequential structure) How do you calculate the miles you are getting per gallon of gasoline if you record the mileage readings from your car’s odometer each time you fill up the gas tank? Two odometer readings should be inputted, one reading is before you fill up the gas tank, and the second reading is when you refill the gas tank. The third input is the quantity of gallons of gasoline purchased when the gas tank is refilled. After inputting these 3 values, calculate and output:arrow_forwardProblem 1: (Hint: Use a sequential structure) How do you calculate the miles you are getting per gallon of gasoline if you record the mileage readings from your car’s odometer each time you fill up the gas tank? Two odometer readings should be inputted, one reading is before you fill up the gas tank, and the second reading is when you refill the gas tank. The third input is the quantity of gallons of gasoline purchased when the gas tank is refilled. After inputting these 3 values, calculate and output: The miles traveled between gas refills The average miles per gallon based on the miles traveled and the amount of gasoline purchased after the time the gas tank is refilled Algorithm: Data Example:arrow_forward(Computer-Assisted Instruction: Reducing Student Fatigue) One problem in CAI environments is student fatigue. This can be reduced by varying the computer’s responses to hold the student’s attention. Modify the program of Exercise 6.57 so that various comments are displayed for each answer as follows: Possible responses to a correct answer: Very good!Excellent!Nice work!Keep up the good work! Possible responses to an incorrect answer: No. Please try again.Wrong. Try once more.Don't give up!No. Keep trying.Use random-number generation to choose a number from 1 to 4 that will be used to select one of the four appropriate responses to each correct or incorrect answer. Use a switch statement to issue the responses. ------------------------------ EXERCISE 6.57 CODE: ----------------------------- //Name: IhabAtouf//Date:02/23/2023// exercise 6.57 on page 281//program description: create computer-assisted instruction (CAI) program that help students master thier math skills in…arrow_forward
- (Topic:Software Design) Q# 1) Write the difference between Logical and Physical software design, Also give some examples of both.arrow_forward1. (Functions with Loop and Branches) Write a C program that uses the function, PrintShampoo Instructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". Else If more than 4, print "Too many.". Else, print "N: Lather and rinse." for numCycles times, where N is the cycle number, followed by "Done.". End with a new line. [hint: use "for" loop from 1 to numCycles times to get desired display] Example output with input 0: Too few Example output with input 5: Too many Example output with input 4: 1: Lather and rinse. 2: Lather and rinse. 3: Lather and rinse. 4: Lather and rinse. Done. #include /* Your user-defined function goes here */ int main(void) { int user Cycles; scanf("%d", &userCycles); PrintShampoo Instructions (user Cycles); return 0; }arrow_forward(Removing break and continue ) A criticism of the break statement and the continue statement is that each isunstructured. Actually, these statements can always be replaced by structured statements, although doing so can beawkward. Describe in general how you’d remove any break statement from a loop in a program and replace it with some structured equivalent. [Hint: The break statement exits a loop from the body of the loop. The other way to exit is by failing the loop-continuation test. Consider using in the loop-continuation test a second test that indicates “early exit because of a ‘break’ condition.”] Use the technique you develop here to remove thebreak statement from the application.arrow_forward
- (C PROGRAMMING ONLY!) 3. Pet Loverby CodeChum Admin One of the easiest ways to make a pet lover happy is to give them very many pets! My friend, Jhelian is a pet lover and for her 21st birthday, I'm planning to give her very many Dogs. It's very timely because my pet dog just gave birth to a lot of cuties! So I don't really need to buy. All I need is to just give these cute little fur babies to her. Instructions: In the code editor, you are provided with the definition of a struct Dog. This struct needs a character value for its gender, which could either be 'm' for a male Dog or 'f' for a female Dog.Furthermore, an array of Dogs has already been created an each of their genders has been set. Then, on line 16, a call to the function giveDogs() was made where the dogs array was passed.Your task is to implement this giveDogs() function which has the following details:Return type - voidName - giveDogsParametersa pointer/holder of a Dogs arraysize of the Dogs arrayDescription - loops…arrow_forward( C PROGRAMMING ONLY) 5. Simplicity is Beautyby CodeChum Admin In life, simplicity is beauty. Let's try creating something so simple. Let's create a function that accepts the address of an integer and prints n number of asterisks out of it. For example, if the value of the address passed is 5, then the output would be five asterisks in one line. Instructions: In the code editor, you are provided with a main() function that asks the user for an integer and passes the address of this integer to a function call of the simple() function.This simple() function hasn't been implemented yet so your task is just that, to implement it. This has the following description:Return type - voidName - simpleParameter - address of an integerDescription - prints a line of asterisksDO NOT EDIT THE MAIN FUNCTIONInput 1. An integer Output Enter·n:·5*****arrow_forward) (6.arrow_forward
- (Use Python) Use the Design Recipe to write a function, print_histogram that consumes a list of numbers and prints a histogram graph using asterisks to represent each number in the list. Use one output line per number in the list. You may assume that only integers are passed to this function. Your function should ignore negative values. Test Result print_histogram([ 2, 0, 4, 1]) ** ***** print_histogram([10, 5, 3, -1, 8]) **************************arrow_forward(C prog. language)arrow_forward(Java) In which of these cases would it be good to use an enum ? Group of answer choices 1. You want a variable where there is flexibility to allow users to input an arbitrary string containing only a single word (i.e. no spaces). 2. You need to have a variable that encodes which day of the week it is. 3. You need to have a variable for a person’s birthday. 4. You need to output all possible integers between 1 and n, where n is input by the user.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License