C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
bartleby

Videos

Textbook Question
Book Icon
Chapter 5.5, Problem 15E

(Program) Write a program to simulate the rolling of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with t h e   e x p r e s s i o n   d o t s   =   ( i n t ) ( 6.0   *   r a n d o m   n u m b e r   +   1 ) , where random number is between 0 and 1.)

Blurred answer
Students have asked these similar questions
(The conical paper cup problem) You have been given the contract for making little conical cups that come with bottled water. These cups are to be made from a circular waxed paper of 4 inches in radius by removing a sector of length x (see Figure 5-4 below). By closing the remaining part of the circle, a conical cup is made. Your objective is to remove the sector so that the cup is of maximum volume.     Instructions Write a program that prompts the user to enter the radius of the circular waxed paper. The program should then output: The length of the removed sector so that the resulting cup is of maximum volume The maximum volume Calculate your answer to two decimal places.Use 3.141592654 for PI
(The conical paper cup problem) You have been given the contract for making little conical cups that come with bottled water. These cups are to be made from a circular waxed paper of 4 inches in radius by removing a sector of length x (see Figure 5-4 below). By closing the remaining part of the circle, a conical cup is made. Your objective is to remove the sector so that the cup is of maximum volume.     Instructions Write a program that prompts the user to enter the radius of the circular waxed paper. The program should then output: The length of the removed sector so that the resulting cup is of maximum volume The maximum volume Calculate your answer to two decimal places.Use 3.141592654 for PI Format your output with setprecision(2) to ensure the proper number of decimals for testing!
(Racing car) Write a program that simulates car racing, as shown in Figure 9.29b– d. The car moves from left to right. When it reaches the right end, it restarts from the left and continues the same process. Let the user increase and decrease the car’s speed by pressing the Up and Down arrow keys.Figure 9.29(a) The programs display a fan and (b–c) a moving car. (d) You can redraw a car with a new base point. Use Python

Chapter 5 Solutions

C++ for Engineers and Scientists

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
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