Ict Revision WS

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Question 1:-

REM program to find many different things

CLS

ans$ = "Y"

DO WHILE ans$ = "Y"

PRINT "Which algorithm do you want to continue with? A-Perimeter of rectangle B-Area of
triangle C-Avg marks of core subjects D-Product of 2 numbers E-Circumference of circle"

INPUT Program_Answer$

IF Program_Answer$ = "A" THEN

INPUT "What is length of rectangle"; l

INPUT "What is breadth of rectangle"; b

P=l*2+b*2

PRINT "Perimeter is"; P

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Program_Answer$ = "B" THEN

INPUT "Base of triangle"; b

INPUT "Height of triangle"; h

A = 1 / 2 * (b * h)

PRINT "Area of triangle is"; A

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Program_Answer$ = "C" THEN

INPUT "Marks of Physics"; phy_marks

INPUT "Bio marks"; bio_marks

INPUT "Chem marks"; chem_marks

INPUT "Math marks"; math_marks

avg = phy_marks + bio_marks + chem_marks + math / 4

PRINT "Average of core subjects is"; avg


PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Program_Answer$ = "D" THEN

INPUT "Number one"; num1

INPUT "Number two"; num2

product = num1 * num2

PRINT "Product of your two numbers is"; product

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Product_Answer$ = "E" THEN

INPUT "Enter radius of circle in cm"; radius

circumference = 2 * 3.14 * radius

PRINT "Circumference of circle is:"; circumference

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSE PRINT "Wrong letter entered"

END IF

LOOP

-X-X-X-

Question 2:-

REM a program to complete few tasks

CLS

ans$ = "Y"

DO WHILE ans$ = "Y"

PRINT "Choose which task you want to continue with. A:Convert hours into minutes B:Convert
volume from Litres to millilitres C:Convert grams to kilogram D:Convert kilometre to centimetre"

INPUT Product_Answer$
IF Product_Answer$ = "A" THEN

INPUT "How many hours do you want to convert to minutes"; hrs

mins = hrs * 60

PRINT hrs; "in minutes is:"; mins

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Product_Answer$ = "B" THEN

INPUT "How many litres do you want to convert to millilitres"; litres

millilitres = litres * 1000

PRINT litres; "in millilitres is"; millilitres

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Product_Answer$ = "C" THEN

INPUT "How many grams do you want to convert to kilograms"; grams

kilograms = grams / 1000

PRINT grams; "in kilograms is"; kilograms

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF Product_Answer$ = "D" THEN

INPUT "How many kilometres do you want to convert to centimetres"; kilometres

centimetres = kilometres * 100000

PRINT kilometres; "in centimetres is"; centimetres

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSE PRINT "Wrong answer given"

END IF

LOOP

-X-X-X-
Question 3:-

REM a program to complete few tasks

CLS

ans$ = "Y"

DO WHILE ans$ = "Y"

PRINT "Choose which task you want to continue with. A:Average of subjects to determine pass or
fail B:Minimum value between 2 numbers C:Herbivore or carnivore D:Shape rectangle or
square"

INPUT product_answer$

IF prodcut_answer$ = "A" THEN

INPUT "Marks of english"; eng

INPUT "marks of bio"; bio

INPUT "marks of chem"; chem

INPUT "marks of physics"; physics

INPUT "marks of math"; math

INPUT "marks of hindi"; hindi

INPUT "marks of geography"; geo

INPUT "marks of history"; hist

INPUT "marks of ICT"; ict

avg = eng + bio + chem + physics + math + hindi + geo + hist + ict / 9

IF avg >= 40 THEN

PRINT "Pass"

ELSE PRINT "fail"

END IF

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF product_answer$ = "B" THEN

INPUT "Number 1"; num1

INPUT "Number 2"; num2


IF num1 > num2 THEN

PRINT num1; "is greater than"; num2

ELSEIF num1 < num2 THEN

PRINT num1; "is greater than"; num2

ELSEIF num1 = num2 THEN

PRINT "Both are equal"

END IF

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF product_answer$ = "C" THEN

INPUT "What is the animal's name"; animal_name$

INPUT "What does it eat? Grass or Meat or Both"; food$

IF food$ = "Grass" THEN

PRINT animal_name$; "is herbivore"

ELSEIF food$ = "Meat" THEN

PRINT animal_name$; "is carnivore"

ELSEIF food$ = "Both" THEN

PRINT animal_name$; "is omnivore"

ELSE PRINT "Enter with first letter caps or input wrong"

END IF

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF product_answer$ = "D" THEN

PRINT "Are all sides of the shape equal? 'Y' or 'N' only"

INPUT sides$

IF sides$ = "Y" THEN

PRINT "It's a square"

ELSEIF sides$ = "N" THEN

PRINT "It's not a square"

ELSE PRINT "Wrong input"

END IF
PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

END IF

LOOP

-X-X-X-X-

Question 4:-

REM a program to complete few tasks

CLS

ans$ = "Y"

DO WHILE ans$ = "Y"

PRINT "Choose which program you want to continue with. A:100 to 50 in reverse order
B:Print a name 5 times C:print even numbers from 20 to 30"

INPUT product_answer$

IF product_answer$ = "A" THEN

FOR ctr = 100 TO 50

PRINT ctr

ctr = ctr - 1

NEXT

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

ELSEIF product_answer$ = "B" THEN

INPUT "What is your name"; name$

FOR ctr = 1 TO 9

PRINT name$

ctr = ctr + 1

NEXT

PRINT "Do you want to continue? 'Y' or 'N' only"


INPUT ans$

ELSEIF product_answer$ = "C" THEN

FOR ctr = 20 TO 30 STEP 1

PRINT ctr

ctr = ctr + 1

NEXT

PRINT "Do you want to continue? 'Y' or 'N' only"

INPUT ans$

END IF

LOOP

-X-X-X-X-

You might also like