Professional Documents
Culture Documents
Com 113 Fashoro Assignment Group 1
Com 113 Fashoro Assignment Group 1
CLS
REM “Area of a rectangle”
INPUT “Enter length of a rectangle”, L
INPUT "Enter width of a rectangle”, W
AREA = L * W
PRINT “Area of the rectangle”, AREA
END
QUESTION 2: To calculate Perimeter of a Rectangle
CLS
REM “Perimeter of a rectangle”
INPUT “Enter length of a rectangle”, L
INPUT "Enter width of a rectangle”, W
PERIMETER = 2 * (L * W)
PRINT “Perimeter of the rectangle”, PERIMETER
END
QUESTION 3: To calculate Area of a Circle
CLS
REM “Area of a circle”
INPUT “Enter radius of a circle”, R
LET PI = 3.14159
AREA = PI * R * R
PRINT “Area of a circle”, AREA
END
QUESTION 4: To calculate Perimeter of a Circle
CLS
REM “Perimeter of a circle”
INPUT “Enter radius of a circle”, R
LET PI = 3.14159
PERIMETER = 2 * PI * R
PRINT “Perimeter of a circle”, PERIMETER
END
QUESTION 5: To calculate Sum of two different numbers
CLS
REM “Program to calculate sum of two different numbers”
INPUT “Enter first number”, A
INPUT "Enter second number”, B
SUM = A + B
PRINT “Sum of two number”, SUM
END
QUESTION 6: To calculate Product of two different numbers
CLS
REM “Program to calculate product of two different numbers”
INPUT “Enter first number”, A
INPUT "Enter second number”, B
PRODUCT = A * B
PRINT “Product of two number”, PRODUCT
END
QUESTION 7: To calculate difference of two different numbers
CLS
REM “Program to calculate difference of two different
numbers”
INPUT “Enter first number”, A
INPUT "Enter second number”, B
DIFFERENCE = A - B
PRINT “Product of two number”, DIFFERENCE
END
QUESTION 8: To input three different numbers and decide the smallest
CLS
REM “Program to input three different numbers and decide the smallest
number amongst the three using IF….THEN statement”
INPUT “Enter first number”, A
INPUT “Enter second number”, B
INPUT “Enter third number”, C
IF A < B AND A < C THEN
PRINT “Smallest number”, A
ELSE IF B < A AND B < C THEN
PRINT “Smallest number”, B
ELSE
PRINT “Smallest number”, C
END IF
QUESTION 9: To input days of the week and decide “School days”
CLS
DO
PRINT "Enter the day of the week (or Q to quit): ";
INPUT dayOfWeek$
IF UCASE$(dayOfWeek$) = "Q" THEN
PRINT "Program terminated."
END
END IF
IF UCASE$(dayOfWeek$) = "SATURDAY" OR
UCASE$(dayOfWeek$) = "SUNDAY" THEN
PRINT "Holiday"
ELSE
PRINT "School day"
END IF
PRINT
LOOP
QUESTION 10: To decide whether an input number is divided by
5 and 3 or not.
CLS
REM
END
SUBMITTED TO:
MR. FASHORO (LECTURER-IN-CHARGE)
JULY, 2023