CRITICAL THINKING AND PROBLEM SOLVING FOR IT

Verified

Added on  2019/10/30

|8
|830
|314
Report
AI Summary
The assignment content is about critical thinking and problem-solving for IT, specifically focusing on programming concepts such as loops, conditionals, and modularization. It includes solutions to three problems: defining a diagram for input, processing, and output; counting the number of families with no children or more than 4 children, and finding the largest number of children in any family; and calculating the average and count of even numbers.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: CRITICAL THINKING AND PROBLEM SOLVING FOR IT
SIT105 Critical Thinking and Problem Solving for IT
Name of the Student:
Name of the University:
Author Note

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
Answer to question 1
Defining Diagram
Input Processing Output
INPUT DATA IF DATA >= 0 AND
DATA<= 18200
NIL
IF DATA >= 18201 AND
DATA<= 37,000
19C FOR EACH $1 OVER
$18,200
IF DATA >= 37001 AND
DATA<= 80000
$3,572 PLUS 32.5C FOR
EACH $1 OVER $37,000
IF DATA >= 80001 AND
DATA<= 180000
$17,547 PLUS 37C FOR
EACH $1 OVER $80,000
IF DATA >= 180001 $54,547 PLUS 45C FOR
EACH $1 OVER $180,000
Answer to question 2
AVERAGE_OF_NUMBERS
count = 0
sum = 0
DO I = 0 to 11
READ n [I]
I = I + 1
Document Page
2
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
ENDDO
DOWHILE I < 11
sum = sum + n [I]
I = I + 1
ENDDO
DO I = 0 to 11
DOWHILE n [I] = 6
count = count + 1
ENDDO
I = I + 1
ENDDO
Average = Sum / 11
PRINT Average
PRINT count
END
Answer to question 3
EVEN_NUMBER
READ P //Input P
Document Page
3
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
SUM = 0 //Initialize Sum to 0
DO 1 to P //For Loop
IF P%2 = 0
SUM = SUM + P
ENDIF
ENDDO //End For
Average = SUM / P
PRINT Average //Print Answer
END
Modularization
Main module Sub module
EVEN_NUMBER
READ P
SUM = 0
AVG (P)
PRINT Average
END
AVG (READ A)
DO 1 to A
IF A%2 = 0
SUM = SUM + A
ENDIF
ENDDO
Average = SUM / A

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
Error Messages
Error messages would be encountered if the value of P entered by the user is negative.
“Please enter an appropriate value” would be displayed by the system.
Answer to question 4
COUNTING_SAMPLE
READ P //Input the value of P
COUNT1 = 0 //Initializing the values
COUNT2 = 0
COUNT3 = 0
DO I = 0 TO P //For Loop
READ N [I]
I = I + 1
ENDDO
DO I = 0 TO P
IF n [I] = 0
COUNT1 = COUNT1 + 1
ELSEIF n [I] > 4
COUNT2 = COUNT2 + 1
Document Page
5
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
ENDIF
I = I + 1
ENDDO
COUNT3 = n [0]
DO I = 0 TO P
IF COUNT3 > n [I]
COUNT3 = COUNT3
ELSE
COUNT3 = N [I]
ENDIF
ENDDO
PRINT COUNT1 // The number of families with no children
PRINT COUNT2 // The number of families who have more than 4 children
PRINT COUNT3 // The largest number of children existing in any family
END
Modularization
Main module Sub module
COUNTING_SAMPLE ZERO_MEMBER (READ N[I], READ P)
Document Page
6
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
READ P
COUNT1 = 0
COUNT2 = 0
COUNT3 = 0
DO I = 0 TO P
READ N [I]
I = I + 1
ENDDO
ZERO_MEMBER (N[I], P)
MAX_MEMBER (N[I], P)
PRINT COUNT1
PRINT COUNT2
PRINT COUNT3
END
DO I = 0 TO P
IF n [I] = 0
COUNT1 = COUNT1 + 1
ELSEIF n [I] > 4
COUNT2 = COUNT2 + 1
ENDIF
I = I + 1
ENDDO
RETURN COUNT1, COUNT2
MAX_MEMBER (READ N[I], READ P)
COUNT3 = n [0]
DO I = 0 TO P
IF COUNT3 > n [I]
COUNT3 = COUNT3
ELSE
COUNT3 = N [I]
ENDIF
ENDDO
Error Messages

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
CRITICAL THINKING AND PROBLEM SOLVING FOR IT
Error messages would be encountered if the value of P entered by the user is negative.
“Please enter an appropriate value for P” would be displayed by the system.
Error messages would be encountered if the value of N entered by the user is negative.
“Please enter an appropriate value for N” would be displayed by the system.
Error messages would be encountered if the value of I is not initialized.
“Please initialize the value of I” would be displayed by the system.
Defining Diagram
INPUT PROCESSING OUTPUT
INPUT DATA
VALUE OF P
VALUE OF N
DO I = 0 TO P
IF n [I] = 0
COUNT1 = COUNT1 + 1
DO I = 0 TO P
ELSEIF n [I] > 4
COUNT2 = COUNT2 + 1
DO I = 0 TO P
IF COUNT3 > n [I]
COUNT3 = COUNT3
DO I = 0 TO P
ELSE
COUNT3 = N [I]
Hierarchy Chart
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]