Question: answer within a hour please,urgent. DevC++ 2. For question 2, refer to file Test2_Q2.cpp provided. Correct the code so that it can be run and

 answer within a hour please,urgent. DevC++ 2. For question 2, refer

answer within a hour please,urgent. DevC++

2. For question 2, refer to file Test2_Q2.cpp provided. Correct the code so that it can be run and match the output as in Figure 1. List out all the corrections made to run the code clearly and if NOT, NO marks will be given. (8 marks) Enter the liters used (Between -1 to end): 2 Enter the distance driven : 7 The km/liters for the car tank was 3.5 Enter the liters used (Between -1 to end): 2.5 Enter the distance driven: 11 The km/liters for the car tank was 4.4 Enter the liters used (Between -1 to end): -1 The overall average km/liters was 4 Process exited after 24.55 seconds with return value o Press any key to continue Figure 1: Example output of question 2. Example how to answer: a. Add #include 3. For question 3, refer to file Test2_Q3.cpp provided. Correct the code so that it can be run and match the output as in Figure 2. List out all the corrections made to run the code clearly and if NOT, NO marks will be given. (5 marks) 18 60 -42 78 Process exited after 0.8786 seconds with return value o Press any key to continue. Figure 2: Example output of question 3. 4. For question 4, refer to file Test2_Q4.cpp provided. Correct the code so that it can be run and match the output as in Figure 3. List out all the corrections made to run the code clearly and if NOT, NO marks will be given. (7 marks) This program adds two numbers. Would you like to run the progran: (Y/y) Y Enter two numbers: 12 113 12.00 + 13.00 = 25.00 Average 2 numbers = 12.50 Would you like to add again: (Y/y) y Enter two numbers : 5 2 5.00 + 7.00 - 12.00 Average 2 numbers = 6.00 Would you like to add again: (Y/y) n Process exited after 24.55 seconds with return value o Press any key to continue Figure 3: Example output of question 4

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!