C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Question
Chapter 3.4, Problem 5E
Program Plan Intro
- The following variables are used in this program:
- m1is a floating type variable to store the mass placed on the first piston.
- m2is a floating type variable to store the mass placed on the second piston.
- r1is a floating type variable to store the radius of the piston supporting mass m1.
- r2is a floating type variable to store the radius of the piston supporting mass m2.
- pow()function is used to calculate the power of a number.
Program Description:The main purpose of the program is to find the distance between the two points with the given coordinates. The given formula to calculate the distance is shown below:
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
P5. (
Boolean Algebra Circuit.
(1)
Transform the following Boolean equation in SOP form to POS form:
Y = F(A, B, C, D) = ĀB + CD
(2)
Expand the following Boolean equation into a sum of minterms, where each minterm should have the
three input variables in their original or complement forms.
Y = F(A, B, C) = AC + AB
(3) Simplify the following Boolean equations using Boolean theorems. For each step in the minimization
process, show which theorem or axiom or method or definition is used to get there.
Y = ABC + B + AC + B
(4)
Transform the following Boolean equation to an equation that only has 2-input NAND gate(s) and/or NOT
gate(s). You are not required to draw a schematic.
Y = A + B + C
EXAMPLE: The sum of any two even integers is even.
Answer:
Proof. (direct) Suppose x and y are even integers. By definition of even, let x = 2k and y = 2j for some
integers j and k. Then,
x+y=2k+2j = 2(k + j)
Note that k+j is an integer because it is the sum of integers. Therefore, by definition of even, x + y is
even.
EXAMPLE: The sum of any two even integers is even.
Answer:
Proof. (direct) Suppose x and y are even integers. By definition of even, let x = 2k and y = 2j for some
integers j and k. Then,
x+y=2k+2j = 2(k + j)
Note that k+j is an integer because it is the sum of integers. Therefore, by definition of even, x + y is
even.
Chapter 3 Solutions
C++ for Engineers and Scientists
Ch. 3.1 - (General math) Write an assignment statement to...Ch. 3.1 - (General math) Write an assignment statement to...Ch. 3.1 - (Conversion) Write an assignment statement to...Ch. 3.1 - Prob. 4ECh. 3.1 - (Physics) Write an assignment statement to...Ch. 3.1 - (Numerical) Write an assignment statement to...Ch. 3.1 - (Civil eng.) Write an assignment statement to...Ch. 3.1 - (Physics) Coulomb’s Law states that the force, F,...Ch. 3.1 - (Civil eng.) Write an assignment statement to...Ch. 3.1 - (Desk check) Determine the output of the following...
Ch. 3.1 - (Debug) Determine and correct the errors in the...Ch. 3.1 - Prob. 12ECh. 3.1 - Prob. 13ECh. 3.1 - (General math) The area of an ellipse (see Figure...Ch. 3.1 - Prob. 15ECh. 3.2 - Prob. 1ECh. 3.2 - Prob. 2ECh. 3.2 - (Practice) Write a C++ program that displays the...Ch. 3.2 - Prob. 4ECh. 3.2 - Prob. 5ECh. 3.2 - Prob. 6ECh. 3.2 - Prob. 7ECh. 3.2 - Prob. 8ECh. 3.2 - (Electrical eng.) The combined resistance of three...Ch. 3.2 - Prob. 10ECh. 3.2 - Prob. 11ECh. 3.2 - (Civil eng.) Write a C++ program to calculate and...Ch. 3.3 - Prob. 1ECh. 3.3 - Prob. 2ECh. 3.3 - (Practice) Write C++ statements for the following:...Ch. 3.3 - Prob. 4ECh. 3.3 - (General math) Write, compile, and run a C++...Ch. 3.3 - (General math) If a 20-foot ladder is placed on...Ch. 3.3 - (Physics) The maximum height reached by a ball...Ch. 3.3 - (Transportation) Road construction requires...Ch. 3.3 - Prob. 9ECh. 3.3 - Prob. 10ECh. 3.3 - Prob. 11ECh. 3.3 - Prob. 12ECh. 3.4 - Prob. 1ECh. 3.4 - (Practice) a. Write a C++ program that first...Ch. 3.4 - Prob. 3ECh. 3.4 - Prob. 4ECh. 3.4 - Prob. 5ECh. 3.4 - Prob. 6ECh. 3.4 - (General math) a. Write, compile, and run a C++...Ch. 3.4 - Prob. 8ECh. 3.4 - Prob. 9ECh. 3.4 - (Electrical eng.) For the series circuit shown in...Ch. 3.4 - Prob. 11ECh. 3.4 - Prob. 12ECh. 3.4 - Prob. 13ECh. 3.5 - Prob. 1ECh. 3.5 - Prob. 2ECh. 3.5 - Prob. 3ECh. 3.5 - Prob. 4ECh. 3.5 - Prob. 5ECh. 3.6 - Prob. 1ECh. 3.6 - (General math) The value of p can be approximated...Ch. 3.6 - Prob. 3ECh. 3.6 - (General math) The volume of oil stored in an...Ch. 3.6 - Prob. 5ECh. 3.6 - (General math) The perimeter, approximate surface...Ch. 3.6 - Prob. 7ECh. 3.6 - Prob. 8ECh. 3.6 - Prob. 9ECh. 3 - (General math) a. Write a C++ program to calculate...Ch. 3 - General math) a. Write a C++ program to calculate...Ch. 3 - (General math) Modify the program written for...Ch. 3 - (Biology) The number of bacteria, B, in a culture...Ch. 3 - Prob. 5PPCh. 3 - (Heat transfer) The formula developed in Exercise...Ch. 3 - Prob. 7PPCh. 3 - (Electrical eng.) a. The voltage gain of an...Ch. 3 - (Electrical eng.) a. Write, compile, and run a C++...Ch. 3 - (Electrical eng.) The amplification of electronic...Ch. 3 - (Acoustics) The loudness of a sound is measured in...Ch. 3 - (General math) a. A balance has the following...
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
- ---BOOLEAN FORMULAS TO CIRCUITS--- The following question requires you to draw circuit diagrams. Draw these out, for each of these problems, translate the given formula directly, without any simplifcation. 6.) Write `A + (B + CD)` as a circuit.arrow_forward---BOOLEAN FORMULAS TO CIRCUITS--- The following question requires you to draw circuit diagrams. Draw these out, for each of these problems, translate the given formula directly, without any simplifcation. 7.) Write `!(AB + CD)` as a circuit.arrow_forwardComputer Science Please help You went camping overnight but forgot to take with you a heater and need to make one using a dc battery of V0 and spare electrical wires of different lengths and resistivity. The battery has lead with the resistance of Rw. Please obtain the formula for the joule heat power and plot it as a function of RH ( in MATLAB) and in comparison to the resistance of the connecting leads, Rw. (Note: express RH = x Rw, where x is the effective ratio; vary x and plot Pmax vs. x). and Find the heating power if the heater is made out of superconducting metal. Will this heater work and why?! What is to happen on the molecular ( i.e. electron) level ?!arrow_forward
- Dont understand how to do c, d, e using matlabarrow_forward(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.arrow_forward(b) Write down a Boolean formula for the function f, given the following truth table. [You may use any reasonable notation, but you must be consistent.] a b с f(a,b,c) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1arrow_forward
- (Ouestion Number (3) a) Apply Boolean algebra to simplify the following expressions: Y = (ABCD + ABCD+ABCD + ABCD)+D b) Develop the Boolean equation for the following logic network and develop the truth table, néxt simplify it and develop RLL circuit for the same Boolean equation: A B 2xy 2xarrow_forward((AB׳C)׳+B)׳׳.(A+C׳)׳.B Simplify logic equationsarrow_forward(xiii) Determine all the permutations of the numbers less than or equal to some given number n. For example, if n = 123, then the permutations are: 123 321 231 132 213 312 (xiv) Find a series of five consecutive numbers, the sum of the squares of the first three of which is equal to the sum of the squares of the last two. For example, (– 2)2+ (– 1)2+ 02= 12+ 22 (xv) Limit the checking within 1000, to show all the triad numbers within 10,000. A number is said to be a triad number if the double and triple of the number contain all separate digits with no repetition of any one of them. (xvi) Identify and show the integer values of x, y, and z that satisfy the equation: Z²= X²+ y²arrow_forward
- 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…arrow_forwardB7arrow_forward(Q2) Simplify the Boolean function F together with the don't-care conditions d in (1) sum-of-products form SOP and (2) product-of-sums form POS. F(w, x, y, z) = E m(0, 1, 2, 3, 7, 8, 10) d(w, x, y, z) = E m(5, 6, 11, 15)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