Question: help needed CSC151-Programming DB3; The differences between the integer and double type Variables: (20 pts total Post all solutions for questions 1-6 below. Explain Why?

 help needed CSC151-Programming DB3; The differences between the integer and double

help needed

CSC151-Programming DB3; The differences between the integer and double type Variables: (20 pts total Post all solutions for questions 1-6 below. Explain Why? 1. average1 is declare to the integer type's variable and assign the integer value (total) is divided by the double type value (2.0) 2. average2 is declare to the integer type's variable and assign the integer value (total) is divided by the integer type value (2) 3. average s declare to the double type's variable and assign the integer value total) is divided by the double type value (2.0) 4. average4 is declare to the double type's variable and assign the integer value (total) is divided by the integer type value (2) 5. Using casts static cast double total/2) for the average? (see Type Casting from Sec. 3 6. Using casts static cast double (total/2.0) for the average? The differences between the integer and double type variables. V/If the declaration is declared to the double type, it will be displayed the double type's value. t include kiostream 2 using namespace std 3 int main( int num1 6 int num2 13; int total num1 num2 8 int average1 total/2 //integer type 9 int average2 total/2.0; //integer type 10 double average total /2; //double type 11 double average4 total/2.0; //double type 13 cout "The total of 12 and 13 is total and their average is average1 14 endli and their average is average total 12 and 13 is cout "The total 15 16 average3 17 cout "The total of 12 and 13 is total and their average is 18 endl 19 cout The total of 12 and 13 is total and their average is average4 21 cout The total of 12 and 13 is total and their average is 22 static cast double (total/2) endl; 23 cout The total of 12 and 13 is total and their average is 24 static cast double (total/2.0) endl; 25 cin ignore 26 28 29 )//end program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!