![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_largeCoverImage.gif)
(a)
The following program will determine the value of int(a) where value of a=10.6.
(a)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 floata=10.6; //determine and print the value of int(a) cout<<int(a); //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6, which is floating-point type value. The int(a) will typecast the value of a to integer type so that it will print only integer part only.
Sample Output:
(b)
The following program will determine the value of int(b) where the value of b=13.9.
(b)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable b with value 13.9 floatb=13.9; //determine and print the value of int(b) cout<<int(b); //exiting from program return0; }
Explanation:
In the above code, the value of b is 13.9, which is floating-point type value. The int(b) will typecast the value of a to integer type so that it will print only integer part only.
Sample Output:
(c)
The following program will determine the value of int(c) where the value of c=-3.42.
(c)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable c with value -3.42 floatc=-3.42; //determine and print the value of int(c) cout<<int(c); //exiting from program return0; }
Explanation:
In the above code, the value of c is -3.42, which is floating-point type value. The int(c) will typecast the value of a to integer type so that it will print only integer part only.
Sample Output:
(d)
The following program will determine the value of int(a+b) where the value of a=10.6 and b=13.9.
(d)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 and bwith value 13.9 float a=10.6, b=13.9; //determine and print the value of int(a+b) cout<<int(a+b); //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6 and b is 13.9, which is floating-point type value. The int(a+b) will first add the value a and b then typecast the value of its result to an integer type and then print the value using cout statement.
Sample Output:
(e)
The following program will determine the value of int(a+b) where the value of a=10.6, b=13.9 and c=-3.42.
(e)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6, b with 13.9 and c with -3.42 float a=10.6, b=13.9, c=-3.42; //determine and print the value of int(a)+b+c cout<<int(a)+b+c; //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6, b is 13.9, and c is -3.42, which is floating-point type value. The int(a)+b+c will typecast the value of a to an integer type and then add and print the integer value of a, b and c.
Sample Output:
(f)
The following program will determine the value of int(a+b)+c where the value of a=10.6, b=13.9 and c=-3.42.
(f)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6, b with 13.9 and c with -3.42 float a=10.6, b=13.9, c=-3.42; //determine and print the value of int(a+b)+c cout<<int(a+b)+c; //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6, b is 13.9, and c is -3.42, which is floating-point type value. The int(a+b) will first add the value a and b then typecast the value of its result to an integer type and then add the value of c to it.
Sample Output:
(g)
The following program will determine the value of int(a+b+c) where the value of a=10.6, b=13.9 and c=-3.42.
(g)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6, b with 13.9 and c with -3.42 float a=10.6, b=13.9, c=-3.42; //determine and print the value of int(a+b+c) cout<<int(a+b+c); //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6, b is 13.9, and c is -3.42, which is floating-point type value. The int(a+b+c) will first add the value of a, b and c then typecast the value of its result to an integer type and print the value using cout statement.
Sample Output:
(h)
The following program will determine the value of float(int(a))+b where the value of a=10.6and b=13.9.
(h)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 and b with 13.9 float a=10.6, b=13.9, c=-3.42; //determine and print the value of float(int(a))+b cout<<float(int(a))+b ; //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6and b is 13.9, which is floating-point type value. The float(int(a))+bwill first typecast the value of a to an integer type and then typecast this integer value to float and then add value b to it and print the value using cout statement.
Sample Output:
(i)
The following program will determine the value of float(int(a+b)) where the value of a=10.6and b=13.9.
(i)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 and b with 13.9 float a=10.6, b=13.9, c=-3.42; //determine and print the value of float(int(a+b)) cout<<float(int(a+b)) ; //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6and b is 13.9, which is floating-point type value. The float(int(a+b))will first add the value of a+b and then typecast the value of its result to an integer type and then typecast this integer value to float and print the value using cout statement.
Sample Output:
(j)
The following program will determine the value of abs(a)+abs(b) where the value of a=10.6and b=13.9.
(j)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> #include <cmath> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 and b with 13.9 float a=10.6, b=13.9, c=-3.42; //determine and print the value of abs(a)+abs(b) cout<<abs(a)+abs(b) ; //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6and b is 13.9, which is floating-point type value. The abs(a) and abs(b)function are used to get the absolute value of a and b then add this absolute value with each other and print the value using cout statement.
Sample Output:
(j)
The following program will determine the value of sqrt(abs(a-b)) where the value of a=10.6and b=13.9.
(j)
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program
//included header file #include <iostream> #include <cmath> //included namespace usingnamespacestd; //main function intmain() { //declare variable a with value 10.6 and b with 13.9 float a=10.6, b=13.9, c=-3.42; //determine and print the value of sqrt(abs(a-b)) cout<<sqrt(abs(a-b)); //exiting from program return0; }
Explanation:
In the above code, the value of a is 10.6and b is 13.9, which is floating-point type value. The abs(a-b)function will determine the absolute value of a-b then the sqrt()function will determine the square root value of this resultand print the value using cout statement.
Sample Output:
Want to see more full solutions like this?
Chapter 3 Solutions
C++ for Engineers and Scientists
- Simplify the following expressions by means of a four-variable K-Map. AD+BD+ BC + ABDarrow_forwardCSE330 Discrete Mathematics 1. In the classes, we discussed three forms of floating number representations as given below, (1) Standard/General Form, (2) Normalized Form, (3) Denormalized Form. 2. Let ẞ 2, m = 6, emin = -3 and emax = 3. Answer the following questions: Compute the minimum of |x| for General and Normalized form (a) Compute the Machine Epsilon value for the General and Denormalized form. If we change the value of emax to 6 then how will it affect the value of maximum scale invariant error for the case of Normalized form? Explain your answer. show answer in pen a Don't use any Al tool nd paper then take pi ctures and sendarrow_forwardCSE330: Discrete Mathematics 1. In the classes, we discussed three forms of floating number representations as given below, (1) Standard/General Form, (2) Normalized Form, (3) Denormalized Form. Now, let's take, ẞ = 2, m = 3, emin = -2 and emax = 3. Based on these, answer the following: (a) (b) (c) (d) What are the maximum/largest numbers that can be stored in the system by these three forms defined above? (express your answer in decimal values) What are the non-negative minimum/smallest numbers that can be stored in the system by the denormalized form? (express your answer in decimal values) How many numbers (both non-negative and negative) can be represented in the above mentioned system using the general form? Explain your answer. Find all the decimal numbers for e = 3 and e = 2 in denormalized form, plot them on a real line and prove that all the numbers are not equally spaced. Write the equally spaced sets for the number line you drew. show your answer in Don't use any Al tool pen…arrow_forward
- 3.[20 pts] Find the minimum equivalent circuit for the one shown below (show your work): DAB 0 f(A,B,C,D)arrow_forwardSuppose your computer is responding very slowly to information requests from the Internet. You observe that your network gateway shows high levels of network activity even though you have closed your e-mail client, Web browser, and all other programs that access the Internet. What types of malwares could cause such symptoms? What steps can you take to check whether malware has gained access to your system? What tools can you use at each step? If you identify malware, what ways might it have entered your system? How can you restore your PC to safe operation, including the special software tools you may use?arrow_forwardR languagearrow_forward
- Using R languagearrow_forwardCompare the security services provided by a digital signature (DS) with those of a message authentication code (MAC). Assume that Oscar can observe all messages sent between Rina and Naseem. Oscar has no knowledge of any keys but the public one, in the case of DS. State whether DS and MAC protect against each attack and, if they do, how. The value auth(x) is computed with a DS or a MAC algorithm. In each scenario, assume the message M = x#####auth(x). (Message integrity) Rina has the textual data x = “Transfer $1000 to Mark” to send to Naseem. To ensure the integrity of the data, Rina generates auth(x), forms a message M, and then sends M in cleartext to Naseem. Oscar intercepts the message and replaces “Mark” with “Oscar.” Will Naseem detect this in the case of either DS or MAC? If yes, how will Naseem detect it? If not, why? (Replay) Rina has the textual data x = “Transfer $1000 to Mark” to send to Naseem. To ensure the integrity of the data, Rina generates auth(x), forms a message…arrow_forwardI need to resolve the following....You are trying to convince your boss that your company needs to invest in a license for MS-Project (project management software from Microsoft) before beginning a systems project. What arguments would you give her?arrow_forward
- What are the four types of feasibility? what is the issues addressed by each feasibility component.arrow_forwardI would like to get ab example of a situation where Agile Methods might be preferable versus the traditional SDLC? What are the characteristics of this situation that give Agile Methods an advantage?arrow_forwardWhat is a functional decomposition diagram? what is a good example of a high level task being broken down into tasks in at least two lower levels (three levels in all).arrow_forward
- 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 LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)