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

SBA IT 2021-2022 - Problem Solving & Program Design 01 Sample

The algorithm takes in a student's name and amount paid for enrollment and determines which enrollment package they qualify for based on the amount paid. It repeats this process, displaying the student name and their enrollment package, until a special exit name and amount are entered. It then ends the program and displays a completion message.

Uploaded by

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

SBA IT 2021-2022 - Problem Solving & Program Design 01 Sample

The algorithm takes in a student's name and amount paid for enrollment and determines which enrollment package they qualify for based on the amount paid. It repeats this process, displaying the student name and their enrollment package, until a special exit name and amount are entered. It then ends the program and displays a completion message.

Uploaded by

Naseeb Ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ALGORITHM

START
STORE ‘’ TO Name
STORE 0 TO AmountPaid

DISPLAY “To Exit This Program Enter (abcd) In Name and 9999 In Amount Paid For Enrolment.”

REPEAT
DISPLAY “Please Enter Student’s First Name:”
GET Name
DISPLAY “Please Enter Amount Paid For Enrolment:”
GET AmountPaid

IF (AmountPaid>=1000) AND (AmountPaid<=1200) THEN


DISPLAY “Name You Have Enrolled In The Bronze Package.”

IF (AmountPaid>=1300) AND (AmountPaid<=1400) THEN


DISPLAY “Name You Have Enrolled In The Bronze Package.”

IF (AmountPaid>=1600) THEN
DISPLAY “Name You Have Enrolled In The Bronze Package.”

UNTIL Name=abcd AND AmountPaid=9999


DISPLAY “The Program Has Ended.”
STOP
TRACE TABLE

Student First Amount If IF IF IF Bronze Silver Gold Repeat


ID Name Paid Amount Amount Amount Amount
Paid Paid Paid Paid
=9999 >=1000 >=1300 >=1600
AND AND
Amount Amount
Paid Paid
<=1200 <=1400
1 Aaa 1100 No Yes Yes No No Yes

2 Ccc 1300 No No Yes No Yes No Yes

3 Eee 1600 No No No Yes No No Yes Yes

4 Ggg 1200 No Yes Yes No No Yes

5 Iii 1400 No No Yes No Yes No Yes


6 Kkk 1600 No No No Yes No No Yes Yes

7 Mmm 1100 No Yes Yes No No Yes


8 Ooo 1300 No No Yes No Yes No Yes
9 Qqq 1600 No No No Yes No No Yes Yes
10 Sss 1200 No Yes Yes No No Yes

11 Uuu 1400 No No Yes No Yes No Yes

12 Www 1600 No No No Yes No No Yes Yes


abcd 9999 Yes No No No No
SOURCE CODE

program GreenPalm;

var
Name: String;
AmountPaid: integer;

// This program was created on Monday 31st January 2022


// It was created by Farook Mohammed Jr
// This program was created to identify the Enrolment Option based on amount paid

begin
writeln('To Exit This Program Enter (abcd) in Name and 9999 in Amount Paid For Enrolment to Quit');
repeat
writeln('Please Enter Student First Name:');
readln(Name);
writeln(Name);
writeln('Please Enter Amount Paid for Enrolment');
readln(AmountPaid);
writeln(AmountPaid);

if (AmountPaid >= 1000) and (AmountPaid <= 1200) then


begin
writeln(Name, ', You Have Enrolled In The Bronze Package.');
end

Else if (AmountPaid >= 1300) and (AmountPaid <= 1400) then


begin
writeln(Name, ', You Have Enrolled In The Silver Package.');
end

Else if (AmountPaid = 1600) then


begin
writeln(Name, ', You Have Enrolled In The Gold Package.');
end;

until AmountPaid = 9999;


writeln('The Program Has Ended.');
end.
SCREENSHOT OF PROGRAM EXECUTION

You might also like