0% found this document useful (0 votes)
46 views13 pages

Com 113 Fashoro Assignment Group 1

The document contains 10 programming questions and their solutions in BASIC programming language. It asks to write programs to calculate area and perimeter of rectangles and circles, perform basic math operations, compare numbers, and check divisibility of a number by other numbers.

Uploaded by

sophlucy747
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views13 pages

Com 113 Fashoro Assignment Group 1

The document contains 10 programming questions and their solutions in BASIC programming language. It asks to write programs to calculate area and perimeter of rectangles and circles, perform basic math operations, compare numbers, and check divisibility of a number by other numbers.

Uploaded by

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

FEDERAL POLYTECHNIC OF EDE

DEPARTMENT OF COMPUTER SCIENCE

EDE OSUN STATE, NIGERIA.

AN ASSIGMENT ON COM 113: PRACTICAL

PRODUCE BY ND1 FT GROUP 1:


1. ADENIYI RIDWAN ADEBAYO CS20220103583
2. AKINOLA PETER ILELABAYO CS20220102233
3. AKINBANJI OLUWAPELUMI AKINKUNMI CS20220101243
4. ADEPOJU IBRAHIM OPEYEMI CS20220100551
5. AWOYALE OLUWAJUWONLO DAVID CS20220101625
6. AMOS DAVID DAMILARE CS20220104235
7. AROWOLO YUSUF AMUDA CS20220101080
8. BABAJIDE MICHEAL OLUWASEUN CS20220102883
9. BADMUS FARUQ DAMILOLA CS20220100717
10. BAMIGBODU AYOMIDE SAMUEL CS20220103186
11. BANKOLE MOSES OLUWOLE CS20220100035
12. FALASE EMMANUEL ADEWUNMI CS20220102527
13. KOLAWOLE MUJEEB AKINOLA CS20220104453
14. LAWAL TUNDE KHAMIS CS20220100255
15. ODEKUNLE OPEYEMI AYOOLA CS20220101495
16. OLAWOYIN YUSSUF OPEYEMI CS20220102038
17. OWOLABI FARUQ IYIOLA CS20220100111
18. RAUF ALIMOT AJOKE CS20220100298
QUESTION: Write a program for the following:

1. To calculate Area of Rectangle


2. To calculate Perimeter of a Rectangle
3. To calculate Area of a Circle
4. To calculate Perimeter of a Circle
5. To calculate Sum of two different numbers
6. To calculate Product of two different numbers
7. To calculate difference of two different numbers
8. To input three different numbers and decide the smallest
number amongst the three using IF….THEN statement
9. To input days of the week and decide “School days” or
“Holiday” using IF….THEN statement.
10. To decide whether an input number is divided by 5 and 3
or not.
QUESTION 1: To calculate Area of Rectangle

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

number amongst the three using IF….THEN statement

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”

or “Holiday” using IF….THEN statement.

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

INPUT “Enter a number” N

IF N MOD 5 = 0 AND N MOD 3 = 0 THEN PRINT “The number


is divisible by both 5 and 3,”

ELSE PRINT “The number is not divisible by both 5 and 3.”

END

SUBMITTED TO:
MR. FASHORO (LECTURER-IN-CHARGE)
JULY, 2023

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