


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Computer Science is the study of computers and computational systems. It involves understanding the theory, design, development, and application of software and hardware to solve problems efficiently. This field covers areas such as algorithms, programming languages, data structures, artificial intelligence, computer networks, cybersecurity, and software engineering. Computer science plays a crucial role in advancing technology and impacting various industries through innovation and automation.
Typology: Exercises
1 / 4
This page cannot be seen from the preview
Don't miss anything!



SUB initialise OUTPUT “This program finds the maximums of sets of three numbers. Enter three zeroes when all numbers entered. Program then calculates and outputs the average of the maximums” total = 0 n = 0 ENDSUB SUB promptForNumbers OUTPUT"Please enter first number " num1 = USERINPUT OUTPUT ("Please enter second number " num2 = USERINPUT OUTPUT "Please enter third number " num3 = USERINPUT ENDSUB SUB findMax maxnum = num IF num2>maxnum THEN maxnum = num ELSE IF num3>maxnum THEN maxnum = num ENDIF OUTPUT "Max of the three numbers is is ",maxnum ENDSUB SUB performCalculations total = total + maxnum n=n+ ENDSUB SUB processData promptForNumbers WHILE num1<>0 and num2<>0 and num3<> findMax performCalculations promptForNumbers ENDWHILE ENDSUB SUB calculateAverage average = total/n OUTPUT "Average of maximums is ",average
#Main program starts here initialise processData calculateAverage