Class 7 Computer

Mid-Term

Final-Term

BASIC Booklet Programs

Question 1
To qualify for the competitive examination, a candidate must either belong to the SCIENCE stream or have secured at least 75% marks. Write a BASIC program that asks the user to input their subject stream and percentage, then checks the criteria and displays whether the candidate is eligible for the exam.

10 INPUT "ENTER THE SUBJECT STREAM"; S$
20 INPUT "ENTER THE PERCENTAGE MARKS"; P
30 IF S$ = "SCIENCE" OR P >= 75 THEN PRINT "YOU ARE ELIGIBLE" ELSE PRINT "YOU ARE NOT ELIGIBLE"
40 END

Question 2
Write a BASIC program to input any three different numbers and find and display the greatest number.

10 INPUT "ENTER THREE NUMBERS"; A, B, C 
20 IF A > B AND A > C THEN PRINT A; "IS THE GREATEST" 
30 IF B > A AND B > C THEN PRINT B; "IS THE GREATEST" 
40 IF C > A AND C > B THEN PRINT C; "IS THE GREATEST" 
50 END

Question 3
Write a BASIC program to input the rainfall amount of a city and display a suitable message based on the following table:

RAINFALL (in mm)MESSAGE
Up to 7.5 mmLIGHT RAIN
> 7.5 mm to ≤ 35.5 mmMODERATE RAIN
> 35.5 mmHEAVY RAIN
10 INPUT "ENTER RAINFALL AMOUNT IN MILLIMETER"; R
20 IF R <= 7.5 THEN PRINT "LIGHT RAIN"
30 IF R > 7.5 AND R <= 35.5 THEN PRINT "MODERATE RAIN"
40 IF R > 35.5 THEN PRINT "HEAVY RAIN"
50 END

Question 4
Write a BASIC program to input the weekly sales amount of a salesman and then calculate and display his commission according to the given criteria:

SALES AMOUNT IN ₹COMMISSION %
< ₹50005%
≥ ₹5000 and < ₹2000010%
≥ ₹2000015%
10 INPUT "ENTER WEEKLY SALES"; S
20 IF S < 5000 THEN CP = 5 
30 IF S >= 5000 AND S < 20000 THEN CP = 10
40 IF S >= 20000 THEN CP = 15
50 LET C = S * CP / 100
60 PRINT "COMMISSION AMOUNT: "; C
70 END

Question 5
A student is eligible to participate in the Talent Search Competition if they are 15 years old or older, or if they have passed class 8. Write a BASIC program that accepts a student’s name, age, and class, and then displays whether the student can take part in the competition.

10 INPUT "ENTER NAME"; N$
20 INPUT "ENTER AGE IN YEARS"; A
30 INPUT "ENTER CLASS"; C 
40 IF A >= 15 OR C > 8 THEN PRINT "YOU ARE ELIGIBLE" ELSE PRINT "YOU ARE NOT ELIGIBLE" 
50 END

Question 6
Write a BASIC program to input the measure of an angle and print whether it an acute, obtuse or a right angle.

10 INPUT "ENTER THE ANGLE"; A 
20 IF A > 0 AND A < 90 THEN PRINT "ACUTE ANGLE" 
30 IF A > 90 AND A < 180 THEN PRINT "OBTUSE ANGLE"
40 IF A = 90 THEN PRINT "RIGHT ANGLE"
50 END

Question 7
Write a BASIC program to input the measure of three sides of a triangle and check and display whether it is an equilateral, or an isosceles or a scalene triangle.

10 INPUT "ENTER THREE SIDES"; A, B, C 
20 IF A = B AND B = C THEN PRINT "EQUILATERAL TRIANGLE" 
30 IF (A = B AND B <> C) OR (B = C AND C <> A) OR (C = A AND A <> B) THEN PRINT "ISOSCELES TRIANGLE" 
40 IF A <> B AND B <> C AND C <> A THEN PRINT "SCALENE TRIANGLE" 
50 END

Question 8
Write a BASIC program to enter the measure of three angles of a triangle and check and display whether it is a right-angled triangle or not.

10 INPUT "ENTER THREE ANGLES"; A, B, C 
20 IF A = 90 OR B = 90 OR C = 90 THEN PRINT "RIGHT-ANGLED TRIANGLE" ELSE PRINT "NOT A RIGHT-ANGLED TRIANGLE"
30 END

Question 9
Write a BASIC program to input the name, age and salary of an employee and calculate and display the Insurance premium based on the following table:

AGE (in years)PREMIUM % (percentage of salary)
Up to 35 years8%
> 35 and ≤ 50 years10%
Above 50 years14%
10 INPUT "ENTER NAME, AGE SALARY"; N$, A, S 
20 IF A <= 35 THEN PP = 8 
30 IF A > 35 AND A <= 50 THEN PP = 10 
40 IF A > 50 THEN PP = 14 
50 LET P = S * PP / 100 
60 PRINT "PREMIUM: "; P 
70 END

Question 10
Write a BASIC program to input the number of units consumed and calculate and display the electric bill according to the following criteria:

NUMBER OF UNITSCHARGES PER UNIT (in ₹)
≤ 100 units₹5 per unit
> 100 and ≤ 200 units₹6 per unit
> 200 units₹7 per unit

Moreover, every customer has to pay ₹50 as monthly meter rent.

10 INPUT "ENTER NUMBER OF UNITS CONSUMED"; U 
20 IF U <= 100 THEN C = 5 
30 IF U > 100 AND U <= 200 THEN C = 6 
40 IF U > 200 THEN C = 7 
50 LET T = U * C + 50 
60 PRINT "TOTAL ELECTRICITY BILL: "; T 
70 END