0% found this document useful (0 votes)
133 views

Answers State Transition Diagram

The document contains two questions and answers about state transition diagrams and control flow diagrams. Question 2 discusses a state transition diagram with 4 states - Awaiting job, Queing job, Printing job, and Awaiting user intervention - and transitions between them. It notes that the state coverage is 2 and there is no information provided about transition coverage. Question 4 includes source code for a C++ program that takes user input for n, checks if it is negative, calculates the factorial of n if it is positive, and returns 0.

Uploaded by

skparitbilal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

Answers State Transition Diagram

The document contains two questions and answers about state transition diagrams and control flow diagrams. Question 2 discusses a state transition diagram with 4 states - Awaiting job, Queing job, Printing job, and Awaiting user intervention - and transitions between them. It notes that the state coverage is 2 and there is no information provided about transition coverage. Question 4 includes source code for a C++ program that takes user input for n, checks if it is negative, calculates the factorial of n if it is positive, and returns 0.

Uploaded by

skparitbilal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Question 2:

Answers
State Transition Diagram

Awaiting
job

Queing
job

A waiting
operator
interventi
on

The state coverage in the diagram is 2.


The transition coverage

Question 4:
Answers

1 #include <iostream>
2 using namespace std;
3 int main ()
4{
5 int i, n, f;
6 cout << n = ;
7 cin >> n;
8 if (n < 0){
9 cout << Invalid: << n;
10 n = -1;
11 } else {
12 f = 1;
13 for (i=1; i <= n; i++) {
14 f *= i;
15
16
17 }

Printing
job

Awaiting
user
intervent
ion

18 return 0;
19 }

Control Flow Diagram

ENTE
R

Exit

You might also like