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
(Prism Program) Write a program that can calculate the value of the surface area and volume of a Prism. The surface area of a rectangular prism is the total area of all six faces. When you have a cube, finding the area of one face allows you to find the total surface area of the solid very quickly, since it will be six times the area of one face. A = 2(width x length) + 2(length x height) + 2(height x width) Volume is the amount of 3-dimensional space an object occupies. Volume is measured in cubic units. To find the volume of a rectangular prism, we multiply the length of the prism by the width of the prism by the height of the prism. Volume of rectangular prism = length x width x height The input and Output of your program is as follows: Prism Mania! Prism Result! Valume uf a Rectangular Prm Length 55 Width 22 Volume (Cubic CM 56550 Height 55 Surface Area (CM) 10890 Exit Calculate Do It Again Input Output
(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!
(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

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