Question: HOMEWORK #1 - PROGRAM #2 Instructions :For this program it is REQUIRED that you match the spacing, the reason is this exercise is about formatting.This

HOMEWORK #1 - PROGRAM #2

Instructions:For this program it is REQUIRED that you match the spacing, the reason is this exercise is about formatting.This means you must have "green" complete in Hypergrade for this program.

Write a C++ program that displays the results of the expressions 3.0 *5.0, 7.1 * 8.3 - 2.2, and 3.2 / (6.1 * 5).Display the results of each calculationright aligned rounded to two decimal places.

Your output should look like this (you will need to use setw, fixed and setprecision to get this to work):

here is my code, but its giving me an error.

//Nareh Khodaverdian

#include

usingnamespacestd;

int main()

{

int firstNumber, secondNumber, productOfTwoNumbers;

cout " 3.0 * 5.0 ----- 15.00 7.1 * 8.3 - 2.2 ----- 56.73 3.2 / (6.1 * 5 ----- 0.10 ";

cin firstNumber secondNumber;

productOfTwoNumbers = firstNumber * secondNumber;

return 0;

}

Required Output Your Program's Output 3.0 n 3. 0 n * 5.0 * 5.0 15. 00 in 15.00 An In 7.1 In 7.1 \ * 8.3 8.3 n - 2.2 In - 2.2 56. 72n 56. 73 in In 3.2 An / (6.1 3. 2 n 5 ) (6.1) n 5) 0. 10 n (Your output is too short. ) 0. 10 In

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 Mathematics Questions!