Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: Lets consider the following program: Provide at least 4 test cases. #include using namespace std; int main() { int x, y; cout <

Question 1:

Lets consider the following program: Provide at least 4 test cases.

#include

using namespace std;

int main() {

int x, y;

cout << Please enter an integer value: ;

cin >> x;

if (x >= 15)

{

x++;

y = x + x - 7;

}

else

{

x = x * 2;

y = x * x + 7;

}

cout << x = << x << y = << y << endl;

system(pause);

return 0;

}

  1. Use the step over option to trace the execution of the program for an input value of 15. Copy and paste 2 screenshots showing the execution trace inside both the true and false sections of the if statement for this value.
  2. Repeat for input value 14.

    Test #

    Valid / Invalid Data

    Description of test

    Input Value

    Actual Output

    Test Pass / Fail

    1

    Valid

    2

    Valid

    3

    Valid

    4

    Valid

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

1. Who is your target audience? (everyone cannot be an answer here)

Answered: 1 week ago