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

Lab 6

Lab6

Uploaded by

Noor-Ul Ain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lab 6

Lab6

Uploaded by

Noor-Ul Ain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

a.

Inputs: mark = 75
Correct results: grade = "Pass", "Well done"

Line Grade
Marks Conditions Input/ Output
Number
1
2 75 mark ? 75
3 75>=50 ? T
4 Grade =
Pass
5 Well Done
6

8
9 Grade = Pass
10

b. Inputs: mark = 40
Correct results: grade = "Not pass"

Line Grade
Marks Conditions Input/ Output
Number
1
2 40 mark ? 40
3 40>=50 ? F
4
5
6

7 Not Pass

8
9 Grade = Not Pass
10

Task 2
a. Inputs: waterUsed = 90, customerType (not required)
Correct results: cost = 50

Line Water cost customertyp


Conditions Input/ Output
Number used e
1
2 90 waterUsed ? 90
3 90<100 ? T
4 50
5
6

8
9
10
11
12
13
14
15 Cost = 50
16

b. Inputs: waterUsed = 200, customerType = D


Correct results: cost = 100

Line Water cost customertyp


Conditions Input/ Output
Number used e
1
2 200 waterUsed ? 200
3 200<100 ? F
4
5
6 D Customer type ? D

7 Customertype=”D”?
T
8 200 *
0.5=100
9
10
11
12
13 High Usage
14
15 Cost = 100
16

c. Inputs: waterUsed = 300, customerType = C Correct results: cost = 180

Line Water cost customertyp


Conditions Input/ Output
Number used e
1
2 300 waterUsed ? 300
3 300<100 ? F
4
5
6 D Customer type ? D

7 Customertype=”D”?
F
8
9
10 300 *
0.6=180
11 Commercial Rate
12
13 High Usage
14
15 Cost = 180
16

Task 3
Perform Desk Check for the following sets of conditions
Inputs: numbers = 12, 8, -3.
Correct results: total = 20

Line number
total Conditions Input/ Output
Number
1
2 0
3 12 number ? 12
4 12>= ? T
5
0+12=1
2
6 8 Number ? 8

4 8>=?T

5
12+8=2
0
6 -3 Number ? -3
4 -3>=?F
7
8 Total=20
9

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy