[SOLVED] COMP5710 Homework 2

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Problem Descriptions:

Example of response format is shown in Figure 1.

Example:

Answer:

V(G) = 5
Path # Path C1 C2 C3 C4
1 1-2-11-12-16 F X X F
2 1-2-11-12-13-12-16 F X X T/F
3 1-2-4-5-8-9-16 T F F X
4 1-2-4-5-6-8-9-16 T T F X
5 1-2-4-5-8-4-5-8-9-16 T F T/F X

Legend: T = true, F = false, X = irrelevant Figure 1. Example showing response format

void Q1(){
2 S1;
3 if(C1){
4 S2;
5 }
6 else{
7 S3;
8 }
9 if(C2){
10 S4;
11 }
12 if(C3){
13 S5;
14 }
15 S6;
16 }

void Q2(){
2 if(C1&&C2){
3 S1;
4 while(C3){
5 S2;}
6 }else{
7 if(C4){
8 S3;
9 }else{
10 S4;
11 While(C5){
12 S5;
13 }
14 }
15 }
16 S6;
17 }

void Q1(){
2 for(S1;C1;S2){
3 while(C2){
4 if(C3){
5 S3;
6 }
7 else{
8 if(C4){
9 S4;
10 }
11 }
12 }
13 }
14 S5;
15 }
void Q1(){
2 if(C1){
3 S1;
4 while(C2){
5 if(C3){
6 S2;
7 }
8 else{
9 S3;
10 }
11 }
12 }
13 else{
14 S4;
15 while(C4){
16 S5;
17 while(C5){
18 S6;
19 }
20 }
21 }
22 S7;
23 }

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.