Professional Documents
Culture Documents
Asg202212291539363591 1 212
Asg202212291539363591 1 212
CLASS VI
2022-2023
Write a QBASIC Program which will print the area and perimeter of a Rectangle
'This QBASIC Program will print the area and perimeter of a Rectangle'
'Date : 25.12.2022, Author : Subhadeep Chakraborty'
Cls
Input "Please enter the length of the Rectangle = ", length
Input "Please enter the breadth of the Rectangle = ", breadth
Let perimeter = 2 * (length + breadth)
Let area = length * breadth
Print "Perimeter of the Rectangle is ="; perimeter
Print "Area of the Rectangle is ="; area
Write a QBASIC Program which will print the area and perimeter of a Square
'This QBASIC Program will print the area and perimeter of a Square'
'Date : 25.12.2022, Author : Subhadeep Chakraborty'
Cls
Input "Please enter the side of the Square = ", side
Let perimeter = 4 * side
Let area = side * side
Print "Perimeter of the Square is ="; perimeter
Print "Area of the Square is ="; area
Write a QBASIC Program which will take printed amount of a commodity from user and print the
discount amount and final amount when discount is 15%
'This QBASIC Program will take printed amount of a commodity from user and print the discount
amount and final amount when discount is 15%'
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
Input "Please enter the Printed Amount of the Commodity = ", printed_amount
Let discount = printed_amount * 15 / 100
Let final_amount = printed_amount - discount
Print "Printed Amount of the Commodity = "; printed_amount
Print "Discount is = "; discount
Print "Final Amount after discount is = "; final_amount
Write a QBASIC Program which will check a number divisible by 5 or not
Cls
Input "Please enter the Number = ", number
Let r = number Mod 5
If r = 0 Then
Print "The number is divisible by 5"
Else
Print "The number is not divisible by 5"
End If
End
Cls
Input "Please enter the Number = ", number
Let r = number Mod 2
If r = 0 Then
Print "The number is EVEN"
Else
Print "The number is ODD"
End If
End
Write a QBASIC Program which will check a number Positive, Negative or Zero
Cls
Input "Please enter the Number = ", number
If number > 0 Then
Print "The number is POSITIVE"
ElseIf number < 0 Then
Print "The number is NEGATIVE"
Else
Print "The number is 0"
End If
End
Write a QBASIC Program which will find out maximum number from two number
'This QBASIC Program will find out maximum number from two number'
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
Input "Please enter the 1st Number = ", number1
Input "Please enter the 2nd Number = ", number2
If number1 > number2 Then
Print "First number is greater than the Second Number"
ElseIf number2 > number1 Then
Print "Second number is greater than the First Number"
Else
Print "Both the numbers are equal"
End If
End
Write a QBASIC Program which will find out maximum number from three number
'This QBASIC Program will find out maximum number from three number. Please don't enter same
number twice or thrice'
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
Input "Please enter the 1st Number = ", number1
Input "Please enter the 2nd Number = ", number2
Input "Please enter the 2nd Number = ", number3
If number1 > number2 And number1 > number3 Then
Print "First number is the Maximum"
ElseIf number2 > number1 And number2 > number3 Then
Print "Second number is the Maximum"
ElseIf number3 > number1 And number3 > number2 Then
Print "Third number is the Maximum"
End If
End
Write a QBASIC Program which will take input of a Principal amount, rate of interest and time and
find out the Simple Interest
'This QBASIC Program will take input of a Principal amount, rate of interest and time and find out the
Simple Interest'
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
Input "Please enter the Principal Amount = ", principal_amount
Input "Please enter the Rate of Interest = ", rate_of_interest
Input "Please ener the time (in Year) = ", time
Let simple_interest = (principal_amount * rate_of_interest * time) / 100
Print simple_interest
End
Write a QBASIC Program which will print 1 to 50
'This QBASIC Program will will print 1 to 50’
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
For i = 1 To 50 Step 1
Print i
Next i
End
Cls
For i = 50 To 1 Step -1
Print i
Next i
End
Cls
For i = 1 To 25 Step 2
Print i
Next i
End
Cls
For i = 2 To 25 Step 2
Print i
Next i
End
Write a QBASIC Program which will print a Series like
7 14 21 28 35 42 49 56 63 70
'This QBASIC Program will will print a series like 7 14 21 28 35 42 49 56 63 70 ’
'Date: 25.12.2022 Author: Subhadeep Chakraborty'
Cls
For i = 7 To 70 Step 7
Print i
Next i
End
Cls
For i = 100 To 10 Step -10
Print i
Next i
End
Cls
Let sum = 0
For i = 1 To 25 Step 1
Print i
sum = sum + i
Next i
Print "Sum of first 25 natural numbers is ="; sum
End