Free Essay

Dfggg Fef

In:

Submitted By donaldporter09
Words 932
Pages 4
COMP 122 iLab 1 Introduction to VC++ dot NET IDE
Question Sheet

TEST PLAN: PREDICTED RESULTS

|Test |Input |Predicted Output |
|No. | | |
| |number1 |number2 |Sum |Difference |Product |Quotient |
|1 |6 |3 |9 |3 |18 |2 |
|2 |-6 |-3 |-9 |-3 |18 |2 |
|3 |6 |-3 |3 |3 |18 |-2 |
|4 |-6 |3 |-3 |-9 |-18 |-2 |
|5 |3 |6 |9 |-3 |18 |-.5 |
|6 |6 |6 |12 |0 |36 |1 |
|7 |10 |4 |14 |6 |40 |2.5 |
|8 |6 |1 |7 |5 |6 |6 |
|9 |1 |6 |7 |-5 |6 |.17 |
|10 |1 |1 |2 |0 |1 |1 |
|11 |0 |6 |6 |-6 |0 |0 |
|12 |6 |0 |6 |6 |0 |0 |
|13 |0 |0 |0 |0 |0 |0 |

Table 1: Test plan (predicted results) for intCalcXXX program (IDE: Laboratory1).

ACTUAL RESULTS

|Test |Input |Actual Output |
|No. | | |
| |number1 |number2 |Sum |Difference |Product |Quotient |
|1 | | | | | | |
|2 | | | | | | |
|3 | | | | | | |
|4 | | | | | | |
|5 | | | | | | |
|6 | | | | | | |
|7 | | | | | | |
|8 | | | | | | |
|9 | | | | | | |
|10 | | | | | | |
|11 | | | | | | |
|12 | | | | | | |
|13 | | | | | | |

Table 2: Actual test results for IntCalcXXX program (Laboratory1).

(Use Alt-PrtSc to copy and paste the system error message window here – make sure it is the system error message window and not VCdotNET’s debugger error window.)
|Test |Input |Predicted Output |
|No. | | |
| |number1 |number2 |Sum |Difference |Product |Quotient |
|1 |6 |3 |9 |3 |18 |2 |
|2 |-6 |-3 |-9 |-3 |18 |2 |
|3 |6 |-3 |3 |3 |18 |-2 |
|4 |-6 |3 |-3 |-9 |-18 |-2 |
|5 |3 |6 |9 |-3 |18 |-.5 |
|6 |6 |6 |12 |0 |36 |1 |
|7 |10 |4 |14 |6 |40 |2.5 |
|8 |6 |1 |7 |5 |6 |6 |
|9 |1 |6 |7 |-5 |6 |.17 |
|10 |1 |1 |2 |0 |1 |1 |
|11 |0 |6 |6 |-6 |0 |0 |
|12 |6 |0 |6 |6 |0 |0 |
|13 |0 |0 |0 |0 |0 |0 | INTENTIONAL ERRORS

The last part of this laboratory exercise is to show Visual C++’s response to some common programming errors. Even if you have already experienced these errors when you entered and tried to compile the program earlier, you are to intentionally create them now and answer the questions. The objective here is to pay close attention to Visual Studio’s error messages: Does it accurately flag the line number where the error was introduced? Does the message accurately describe the problem that caused the error?

1. Omit the semicolon after endl in the first line of the INPUT section.

cout > num1; //misspell the variable name number1

1. What is the line number where the error was introduced? _35__________

2. What is the line number flagged by the compiler? __35_________

3. What is the compiler’s exact error message (copy and paste if you wish)?
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(35) : error C2065: 'numer1' : undeclared identifier

4. Is the line number accurate? Does it give the line number where the error was introduced? Yes

5. Is the error message accurate? Does it accurately describe the actual error that prompted the message? Yes

3. Change the spelling of number1 in the declaration statement.

int num1, // Misspell the name of variable “number1” number2;

1. What is the line number where the error was introduced? ___35________

2. What is the line number flagged by the compiler? _35 44 45 46 47 49__________

3. What is the compiler’s exact error message (copy and paste if you wish)?

1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(35) : error C2065: 'number1' : undeclared identifier
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(44) : error C2065: 'number1' : undeclared identifier
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(45) : error C2065: 'number1' : undeclared identifier
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(46) : error C2065: 'number1' : undeclared identifier
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(47) : error C2065: 'number1' : undeclared identifier
1>c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(49) : error C2065: 'number1' : undeclared identifier

4. Is the line number accurate? Does it give the line number where the error was introduced? Yes

5. Is the error message accurate? Does it accurately describe the actual error that prompted the message? Yes

4. Change case of the first letter of cout in the first line of the OUTPUT section. Note that C++ is case sensitive, so Cout and cout are two distinct and different identifiers!

Cout c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(63) : fatal error C1075: end of file found before the left brace '{' at 'c:\users\devon\documents\visual studio 2008\projects\lab01\intcalcddp.cpp(30)' was matched

4. Is the line number accurate? Does it give the line number where the error was introduced? Yes

5. Is the error message accurate? Does it accurately describe the actual error that prompted the message? Yes

6. Omit the last statement in main, return 0.

1. What is the line number where the error was introduced? ____62_______

2. What is the line number flagged by the compiler? __None_________

3. What is the compiler’s exact error message (copy and paste if you wish)?
No error message

4. Is the line number accurate? Does it give the line number where the error was introduced? No

5. Is the error message accurate? Does it accurately describe the actual error that pr pompted the message? There was no error message because the line isn’t needed to run the application as it is only needed to stop the Command Prompt window from closing until the user presses a key.

Similar Documents