Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions