Answered! Write a program that stores the floating point value 16.7 in the variable num1 and the floating value 18.7 in the…

Write a program that stores the floating point value 16.7 in the variable num1 and the floating value 18.7 in the variable number 2 have your program calculate the the total of these numbersand their average. store the totalin variable name total and the average in variable name average.(use the statement average =total/2.0; to calculate the average)

Expert Answer

 #include <iostream>

using namespace std;

int main()
{
float num1 = 16.7;
float num2 = 18.7;
float totalin = num1+num2;

cout<<“total: “<<totalin <<endl;;

float average = totalin/2.0;
cout<<“average: “<<average;
return 0;
}

Still stressed from student homework?
Get quality assistance from academic writers!