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 6.4, Problem 1E
(Practice) The volume, v, and side surface area, s, of a cylinder are given by these formulas:
r is the cylinder’s radius, and l is its length. Using these formulas, write and test a function named cylinder() that accepts a cylinder’s radius and length and returns its volume and side surface area.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(For a and b)
Equation:
a.
f(x) = [()*+10].
12 (3)], for x = 21,2,..
2
b.
x
Use the inverse transform method to
generate variates from the given equation.
With the given equation, derive
mathematically and numerically the mean
and variance.
PROVIDE CODE COMMENTS OR FURTHER
EXPLANATION IF NECESSARY.
Question 1 : (Solve quadratic equations)
The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following
formula :
-b + V² – 4ac
-b – Vb – 4ac
and n =
2a
2a
b² - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation
has two real roots. If it is zero, the equation has one root. If it is negative, the equation has
no real roots.
Write a program Equation.java for solving a quadratic equation that prompts the user to
enter values for a, b, and c and displays the result based on the discriminant. If the
discriminant is positive, display two roots. If the discriminant is 0, display one root.
Otherwise, display "The equation has no real roots".
Note that you can use Math.pow(x, 0.5) to compute the discriminant. Here are some
sample runs.
Enter a, b, c: 1.0 3 1 -Enter
The equation has two roots -0.381966 and -2.61803
Enter a, b, c: 1 2.0 1 -Enter
The equation has one root -1
Enter a, b, c: 1 2 3 -Enter
The equation has no real…
(Heat transfer) The energy radiated from the surface of the sun or a planet in the solar system
can be calculated by using Stefan-Boltzmann's Law:
E = o x T4
E is the energy radiated.
o is Stefan-Boltzmann's constant (5.6697 x 10-8 watts/m2K4).
Tis the surface temperature in degrees Kelvin (°K = °C + 273).
a. Determine the units of E by calculating the units resulting from the right side of the formula.
b. Determine the energy radiated from the sun's surface, given that the sun's average
temperature is approximately 6000°K.
Chapter 6 Solutions
C++ for Engineers and Scientists
Ch. 6.1 - (Practice) For the following function headers,...Ch. 6.1 - Prob. 2ECh. 6.1 - Prob. 3ECh. 6.1 - (Statics) A beam’s second moment of inertia, also...Ch. 6.1 - (Statics) An annulus is a cylindrical rod with a...Ch. 6.1 - Prob. 6ECh. 6.1 - (Physics) Buoyancy is the upward force a liquid...Ch. 6.1 - (Numerical) a. Write a C++ program that accepts an...Ch. 6.1 - (Practice) a. Write a function that produces a...Ch. 6.1 - Prob. 10E
Ch. 6.1 - Prob. 11ECh. 6.1 - Prob. 12ECh. 6.1 - Prob. 13ECh. 6.1 - Prob. 14ECh. 6.1 - Prob. 15ECh. 6.2 - Prob. 1ECh. 6.2 - (Practice) For the following function headers,...Ch. 6.2 - (General math) a. Write a function named...Ch. 6.2 - (General math) a. The volume, V, of a cylinder is...Ch. 6.2 - Prob. 6ECh. 6.2 - Prob. 10ECh. 6.2 - (Numerical) a. The following is an extremely...Ch. 6.2 - Prob. 12ECh. 6.2 - Prob. 13ECh. 6.3 - Prob. 2ECh. 6.3 - Prob. 4ECh. 6.3 - Prob. 5ECh. 6.4 - (Practice) The volume, v, and side surface area,...Ch. 6.4 - (Practice) Write a C++ program that accepts the...Ch. 6.4 - (Simulation) Write a program to simulate the roll...Ch. 6.4 - (Numerical) Write a program that tests the...Ch. 6 - Prob. 1PPCh. 6 - Prob. 2PPCh. 6 - Prob. 6PPCh. 6 - (Numerical) Heron’s formula for the area, A, of a...Ch. 6 - Prob. 10PP
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
- (Growth of function) Express the following in the terms of Θ notation: (n + a)^ b for any real constants a and b, where b > 0. Please show your work by giving the constants c1, c2, and n0.arrow_forward(Homework's) Q1/ Two shafts which are 300 mm apart are to be connected by spur gearing. The driving shaft rotates at 1400 rpm and the driven is to be rotate at an approximate speed of 400 rpm If the moduke pitch of the gears is 8 mm, determine the number of teeth on the gears and the actual speed of the driven shaft. Assume that the gears available are of teeth rising in steps of 3 and the smallest gear dose not has teeth kess than 15. Q2/ Find the pitch diameter, diametral pitch and module of a toothed gear having 36 teeth and circular pitch of 13 mm. Q3/ Two wheels of 18 and 45 teeth respective ly are geared together. Determine the pitch circke radius of the two wheeks, if the circular pitch is 50 cm. Q4/ In a compound train of gears spur gear 1, with 40 teeth and rotating at 15 rpm, drives a pinion 6 with 15 teeth at 300 rpm across two intermediate spindles. The first intermediate has gears 2 and 3 and the second carries gears 4 and 5. Gear 2 gearing with gear 1 while 3 gearing with…arrow_forwardQ1) Apply DE Morgan theorem to the following function. ĀB Cc+D)+Earrow_forward
- (Practice) Determine the values of the following integer expressions: a.3+46f.202/( 6+3)b.34/6+6g.( 202)/6+3c.23/128/4h.( 202)/( 6+3)d.10( 1+73)i.5020e.202/6+3j.( 10+3)4arrow_forward(In Matlab Coding) Pls send me solution in 5 min I will like your answer. Solution must be in typed form.arrow_forward(numerical analysis matlab) 3) It is requested to solve the X₁, X2,X3 unknowns in the given equation system by using Gauss-Jordan method. Find the result by writing a program. X1 X2 + x3 = 0 X2 + x3 = 0 3x12x2 + 3x3 = 0 -X1 X3 = 0 -arrow_forward
- (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following formula: -b + VB - 4ac and -b - VB - 4ac 2a 2a b - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a, b, and c and displays the result based on the discriminant. If the discriminant is positive, display two roots. If the discriminant is 0, display one root. Otherwise, display "The equation has no real roots."arrow_forwardQ27) An approximation for the exponential function can be found using what is called a Maclaurin series: x' x? x3 et x 1+ 1! + +... 2! 3! Write a program to investigate the value of e and the exp function.arrow_forward(Software quality engineering)Derive the test cases using equivalent partitioning.arrow_forward
- splir + 1).) 7. (Numerical) Heron's formula for the area, A, of a triangle with sides of length a, b, and cie A = vIsts - aXs - b(s - c)] where (a +b+c) Write, test, and execute a function that accepts the values of a, b, and c as parameters from a calling function, and then calculates the values of s and [s(s - a)(s - b)(s - c)]. If this quantity is positive, the function calculates A. If the quantity is negative, a, b, and c do not form a triangle, and the function should set A = -1. The value of A should be returned by the function.arrow_forwardRedo problem 2 where you have to define and use the following functions: (a) isTriangle - takes 3 sides of a triangle and returns true if they form a triangle, false otherwise. (b) isIsosceles - takes 3 sides of a triangle and returns true if they form an isosceles triangle, false otherwise. (c) isEquilateral - takes 3 sides of a triangle and returns true if they form anequilateral triangle, false otherwise. (d) isRight - takes 3 sides of a triangle and returns true if they form a right triangle, false otherwise. (e) your program should run continuous until the user wants to quit this is my problem 2: #include <iostream> #include <cmath> using namespace std; // Constant Declarations const double E = .0001; int main() { double side1, side2, side3; bool isTriangle, isRight, isEquilateral, isIsosceles; cout << "Enter the lengths of the 3 sides of a triangle -- "; cin >> side1 >> side2 >> side3; isTriangle = side1 + side2 > side3 &&side1 +…arrow_forward(Perkovic, Problem 6.31b) Write a function testCraps that accepts a positive integer n as an input, simulates n games and craps, and returns the fraction of games the player won. ⚫ the testCraps function should not make dice rolls directly, instead... testCraps function should call the craps function repeatedly and keep track of the results • if you your craps and testCraps function simulate the game correctly without any extra rolls, you should be able to hit the results below exactly 1 >>> random.seed(0) 2 >>> testCraps (10000) 3 0.5 4 >>> random.seed(1) 5 >>> testCraps (10000) 6 7 8 0.4921 >>> [(i, random.seed(i), testCraps (100*i)) for i in range(1,10)] [(1, None, 0.49), (2, None, 0.46), (3, None, 0.47333333333333333), (4, None, 0.5125), (5, None, 0.476), (6, None, 0.47333333333333333), (7, None, 0.4514285714285714), (8, None, 0.48), (9, None, 0.4855555555555556)] 9 >>arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
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