15.07.2015 Views

COMP 122 Lab 4 Lab Report and Source Code

COMP 122 Week 4 Lab Part 1 Part 1 of this week’s lab will give you an opportunity to use the debugging capabilities of Visual Studio. Part 2 will present a problem for which you will need to create a test plan and actually test an executable program to determine if it behaves correctly. Part 1 – Using the Debugger To begin this exercise, create a VC++ project and copy the following code into your project. Make sure that the project compiles successfully. #include using namespace std; int main() { int input; int , ; int ; cout<"enter="" which="" number="" in="" the="" fibonacci="" number="" sequence="" you="" want="" to="" find."=""><endl;=""> cout<"the="" first="" and="" second="" fibonacci="" numbers="" are="" 1."=""><endl;=""> cin>> input; while (input < 1)=""> { cout<"you="" must="" enter="" a="" value="" greater="" than="" 0,="" try="" again."=""><endl;=""> cin>> input; } if (input > 2) { for(int ; i &lt; input;="" i++)=""&gt; { ; ; + back2; } } cout<"the="" value="" of="" fibonacci="" number="""="">&lt; input=""&gt;&lt;"="" is="""="">< current=""><endl;=""> cin.ignore(2); return 0; } Part 2 – Black Box Testing A customer has requested a program be developed to meet the following criterion: 1. The program needs to convert from celcius temperatures to fahrenheit temperatures. 2. The user should be able to enter temperatures containing fractional degrees (ie. 12.3) 3. The converted temperatures should be accurate to within 1/10th of a degree. 4. The user should be able to enter the number of temperatures to be converted up to a maximum of 10. 5. The output should be tabular with each row including the input and converted temperature. Write a test plan to thoroughly test this program. The executable for this program is included in with this lab. You should have test cases which verify that the program does all of what is required in the problem specification above. You should also test to see how robust the program is, that is, how does it handle inputs outside the expected ranges. Document your test plan in a table. For each test case, document the expected program behavior and the actual program behavior. If the program does not behave according to your prediction, write a brief explanation of what the program did wrong.

COMP 122 Week 4 Lab Part 1
Part 1 of this week’s lab will give you an opportunity to use the debugging capabilities of Visual Studio. Part 2 will present a problem for which you will need to create a test plan and actually test an executable program to determine if it behaves correctly.
Part 1 – Using the Debugger
To begin this exercise, create a VC++ project and copy the following code into your project. Make sure that the project compiles successfully.
#include
using namespace std;
int main()
{
int input;
int , ;
int ;
cout<"enter="" which="" number="" in="" the="" fibonacci="" number="" sequence="" you="" want="" to="" find."=""><endl;="">
cout<"the="" first="" and="" second="" fibonacci="" numbers="" are="" 1."=""><endl;="">
cin>> input;
while (input < 1)="">
{
cout<"you="" must="" enter="" a="" value="" greater="" than="" 0,="" try="" again."=""><endl;="">
cin>> input;
}
if (input > 2)
{
for(int ; i &lt; input;="" i++)=""&gt;
{
;
;
+ back2;
}
}
cout<"the="" value="" of="" fibonacci="" number="""="">&lt; input=""&gt;&lt;"="" is="""="">< current=""><endl;="">
cin.ignore(2);
return 0;
}
Part 2 – Black Box Testing
A customer has requested a program be developed to meet the following criterion:
1. The program needs to convert from celcius temperatures to fahrenheit temperatures.
2. The user should be able to enter temperatures containing fractional degrees (ie. 12.3)
3. The converted temperatures should be accurate to within 1/10th of a degree.
4. The user should be able to enter the number of temperatures to be converted up to a maximum of 10.
5. The output should be tabular with each row including the input and converted temperature.
Write a test plan to thoroughly test this program. The executable for this program is included in with this lab. You should have test cases which verify that the program does all of what is required in the problem specification above. You should also test to see how robust the program is, that is, how does it handle inputs outside the expected ranges.
Document your test plan in a table. For each test case, document the expected program behavior and the actual program behavior. If the program does not behave according to your prediction, write a brief explanation of what the program did wrong.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>COMP</strong> <strong>122</strong> <strong>Lab</strong> 4 <strong>Lab</strong> <strong>Report</strong> <strong>and</strong> <strong>Source</strong> <strong>Code</strong><br />

Click Here To Buy The Tutorial<br />

http://www.uoptutorial.com/index.php?route=product/product&path=606&product<br />

_id=9227<br />

For more course tutorials visit<br />

www.uoptutorial.com<br />

<strong>COMP</strong> <strong>122</strong> Week 4 <strong>Lab</strong> Part 1<br />

Part 1 of this week’s lab will give you an opportunity to use the debugging capabilities of Visual<br />

Studio. Part 2 will present a problem for which you will need to create a test plan <strong>and</strong> actually<br />

test an executable program to determine if it behaves correctly.<br />

Part 1 – Using the Debugger<br />

To begin this exercise, create a VC++ project <strong>and</strong> copy the following code into your project.<br />

Make sure that the project compiles successfully.<br />

#include<br />

using namespace std;<br />

int main()<br />

{<br />

int input;<br />

int , ;<br />

int ;<br />

cout< "enter="" which="" number="" in="" the="" fibonacci="" number="" sequence="" you=""<br />

want="" to="" find."="">


cout< "the="" first="" <strong>and</strong>="" second="" fibonacci="" numbers="" are="" 1."=""><br />

cin>> input;<br />

while (input < 1)=""><br />

{<br />

cout< "you="" must="" enter="" a="" value="" greater="" than="" 0,="" try=""<br />

again."=""><br />

cin>> input;<br />

}<br />

if (input > 2)<br />

{<br />

for(int ; i < input;="" i++)=""><br />

{<br />

;<br />

;<br />

+ back2;<br />

}<br />

}<br />

cout< "the="" value="" of="" fibonacci="" number="" "="">< input="">< "="" is="" "=""><<br />

current=""><br />

cin.ignore(2);<br />

return 0;<br />

}<br />

Part 2 – Black Box Testing


A customer has requested a program be developed to meet the following criterion:<br />

1. The program needs to convert from celcius temperatures to fahrenheit temperatures.<br />

2. The user should be able to enter temperatures containing fractional degrees (ie. 12.3)<br />

3. The converted temperatures should be accurate to within 1/10th of a degree.<br />

4. The user should be able to enter the number of temperatures to be converted up to a maximum<br />

of 10.<br />

5. The output should be tabular with each row including the input <strong>and</strong> converted temperature.<br />

Write a test plan to thoroughly test this program. The executable for this program is included in<br />

with this lab. You should have test cases which verify that the program does all of what is<br />

required in the problem specification above. You should also test to see how robust the program<br />

is, that is, how does it h<strong>and</strong>le inputs outside the expected ranges.<br />

Document your test plan in a table. For each test case, document the expected program behavior<br />

<strong>and</strong> the actual program behavior. If the program does not behave according to your prediction,<br />

write a brief explanation of what the program did wrong.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!