C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 6, Problem 3SA
Determine the value of each of the following expressions. (For decimal numbers, round your answer to two decimal places.) (1)
abs(-18)
fabs(20.5)
fabs(-87.2)
pow(4, 2.0)
pow(8.4, 3.5)
sqrt(7.84)
sqrt (196.0)
sqrt (38.44)* pow(2.4, 2) / fabs(-3.2)
floor(27.37)
ceil(19.2)
floor(12.45) + ceil(6.7)
floor (-8.9) + ceil (3.45)
floor(9.6) / ceil(3.7)
pow(-4.0, 6.0)
pow(10, -2.0)
pow(9.2, 1.0 / 2)
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A complex number is a number in the form a+bi, where a and b are real numbers and i is √(-1)
The numbers a and b are known as the real part and imaginary part of the complex number, respectively. You can perform addition, subtraction, multiplication, and division for complex numbers using the following formulas:
a + bi + c + di = (a+c) + (b+d)i (addition)
a + bi − (c + di) = (a−c) + (b−d)i (subtraction)
(a + bi) * (c + di) = (ac−bd) + (bc+ad)i (multiplication)
(a + bi) / (c + di) = (ac+bd) / (c2+d2) + (bc−ad)i / (c2+d2) (division)
You can obtain the Absolute Value for a complex number using the following formula:
|a + bi| = √(a2 + b2)
A Complex number can be interpreted as a point on a plane by identifying the (a,b) values as the coordinates of the point. The absolute value of the complex number corresponds to the distance of the point to the origin, as shown in the example below.
(1) Design a class named Complex for representing complex numbers
Include…
A complex number is a number in the form a + bi, where a and b are real numbers and i is sqrt( -1). The numbers a and b are known as the real part and imaginary part of the complex number, respectively.You can perform addition, subtraction, multiplication, and division for complex numbers using the following formulas:a + bi + c + di = (a + c) + (b + d)ia + bi - (c + di) = (a - c) + (b - d)i(a + bi) * (c + di) = (ac - bd) + (bc + ad)i(a+bi)/(c+di) = (ac+bd)/(c^2 +d^2) + (bc-ad)i/(c^2 +d^2)You can also obtain the absolute value for a complex number using the following formula:| a + bi | = sqrt(a^2 + b^2)(A complex number can be interpreted as a point on a plane by identifying the (a, b) values as the coordinates of the point. The absolute value of the complex number corresponds to the distance of the point to the origin, as shown in Figure 13.10.)Design a class named Complex for representing complex numbers and the methods add, subtract, multiply, divide, and abs for performing complex…
In the expression,
int n = rand() % 33 - 32;
a.
Generates a value in the range [-32, 0]
b.
Generates a value in the range [-32, 32]
c.
Generates a value in the range [0, 33]
d.
Generates a value in the range [-33, 0]
e.
Generates a value in the range [0, 32]
Chapter 6 Solutions
C++ Programming: From Problem Analysis to Program Design
Ch. 6 - Mark the following statements as true or false:
a....Ch. 6 - Determine the value of each of the following...Ch. 6 - Determine the value of each of the following...Ch. 6 - Consider the following function definition. (4, 6)...Ch. 6 - Consider the following statements:
Which of the...Ch. 6 - Prob. 8SACh. 6 - Prob. 9SACh. 6 - Why do you need to include function prototypes in...Ch. 6 - Prob. 11SACh. 6 - Consider the following function: (4)...
Ch. 6 - Prob. 15SACh. 6 - What is the output of the following program? (4)
Ch. 6 - Write the definition of a function that takes as...Ch. 6 - Prob. 18SACh. 6 - How would you use a return statement in a void...Ch. 6 - Prob. 20SACh. 6 - Prob. 21SACh. 6 - What is the output of the following program?...Ch. 6 - Write the definition of a void function that takes...Ch. 6 - Write the definition of a void function that takes...Ch. 6 - Prob. 8PECh. 6 - The following formula gives the distance between...Ch. 6 - Write a program that takes as input five numbers...Ch. 6 - When you borrow money to buy a house, a car, or...Ch. 6 - Consider the definition of the function main:...Ch. 6 - The statements in the following program are not in...Ch. 6 - Write a program that outputs inflation rates for...Ch. 6 - Write a program to convert the time from 24-hour...Ch. 6 - Jason opened a coffee shop at the beach and sells...
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
- (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?arrow_forward(Civil eng.) Write an assignment statement to calculate the linear expansion in a steel beam as a function of temperature increase. The formula for linear expansion, l, is as follows: l=l0(1+(TfT0)) l0isthelengthofthebeamattemperatureT0.isthecoefficientoflinearexpansion.Tfisthefinaltemperatureofthebeam.arrow_forwardWhat is the numeric value of each of the following expressions, as evaluated by the C# programming language? 2+5*3 9/4+10 10/3 2110 (51)*3 37/5 648 5+2*43*4 3*(2+5)/5 2852 19/2/2 28/(2+4)arrow_forward
- C#: Please helparrow_forward2 3 4 5 The following are some examples of Krishnamurthy numbers: 6 7 8 9 0 1 2 3 A Krishnamurthy number is a number whose sum total of the factorials of each digit is equal to the number itself. 4 5 "145" is a Krishnamurthy Number because, 1! + 4! + 5! = 1 + 24 + 120 = 145 "40585" is also a Krishnamurthy Number. 4 + 0 + 5! +8! + 5! = 40585 "357" or "25965" is NOT a Krishnamurthy Number 3! + 5 + 7! = 6 + 120 + 5040 != 357 6 The following function will check if a number is a Krishnamurthy Number or not and return a 7 boolean value. 8 ***arrow_forwardewqeqeqwe python pleasearrow_forward
- find how many errors in the program below to draw this figure? 30 t- 0:pi/50:10*pi; plot2 (sin (t), cos(t),t) 25 20 xlabel('sin(t)') ylabal ('cos (t) ') zlabel ('t') - 15 10 grd on axis square 0.5 0,5 -0.5 0.5 cos(t) -1 sin(t) O 2 O 3 O 6 LOarrow_forwardqeqwqeqeweq python pleasearrow_forwardProgramming Language :- Pythonarrow_forward
- quadratic.py by using "sys.argv" ● Create a program, quadratic.py, that takes in three arguments that represent the a, b, and c values in the quadratic formula. The values should be to two decimal places. You do not need to account for imaginary values. Then print out both roots in the form: “The solutions are x and y” Where x and y correspond to the positive and negative roots, respectively.arrow_forwardEvaluate each of the following expressions. Assume the following: int a = 3, b = 7; float x = 6.0, y = 3.1 z = 2.0 (int)y * 10 + barrow_forwardQ8: Write in Python program: Among all three (3) digit numbers; There are some special numbers where the product of the numbers that make up it and the product of the sum are equal to itself. Number 135 is one of these special numbers. Find out all 3-digit numbers with this feature and how many they are in total and write the program that displays them on the screen. 135 = (1 x 3 x 5) x (1 + 3 + 5) Example Run: Numbers searched: XXX, ..., There are X three-digit numbers with this feature.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License