SOLVED_PROBLEM

1. Write a program in QBASIC to input the height, base and find out the area of triangle. 

INPUT "Enter a height"; H

INPUT "Enter a base"; B

A = 1 / 2 * (H * B)

PRINT "Area of triangle"; A

END


2. Write a program that convert centigrade temperature to Fahrenheit temperature. The formula is: F = (9 / 5) * C + 32. F is Fahrenheit temperature and C is the centigrade temperature. 

REM "Convert a temperature from centigrade to Fahrenheit"

CLS

INPUT "Enter the temperature in centigrade"; C

F = C * (9 / 5) + 32

PRINT "The Fahrenheit value is:"; F

END


3. Write a program to find the cost of painting the four wall of a room.

CLS

INPUT "Enter length of the room"; L

INPUT "Enter breadth of the room"; B

INPUT "Enter height of the room"; H

INPUT "Enter the cost of painting"; C

A = (2 * (L + B)) * H

T = C * A

PRINT "The total cost of painting:"; T

END


4. Write a program to calculate volume and total surface area of a cylinder. (Hint: V = P * R^2 * H and TSA = 2 * P * R * (R + H))

INPUT "Enter a radius"; R

INPUT "Enter a height"; H

V = 3.141 * R^2 * H

PRINT "Volume of a cylinder is:"; V

TSA = 2 × 3.141 * R * (R + H)

PRINT "Total surface area is:"; TSA

END


5. Write a program to find the area of rectangle. (Hint: A = L + B)

CLS

INPUT "Enter a Length"; L

INPUT "Enter a Breadth"; B

A = L + B

PRINT "Area of rectangle:"; L

END


6. Write a program to find area of four wall. (Hint: 2 * (L + B)) * H.)

CLS

INPUT "Enter length of the room"; L

INPUT "Enter breadth of the room"; B

INPUT "Enter height of the room"; H

INPUT "Enter the cost of painting"; C

A = (2 * (L + B)) * H

PRINT "Area of four wall"; A

END


7. Write a program to find area of circle. (Hint: (22 / 7) * R^2)

CLS

INPUT "Enter a radius"; R

A = (22 / 7) * R^2

PRINT "Area of circle"; A

END


8. Write a program to find area of square. (Hint: L^2)

CLS

INPUT "Enter a length"; L

A = L^2

PRINT "Area of square"; A

END


9. Write the program to find the area of Parallelogram. (Hint: A = B * H)

CLS

INPUT "Enter a base"; B

INPUT "Enter a height"; H

A = B * H

PRINT "Area of parallelogram"; A

END


10. Write a program to find the area of trapezium. (Hint: A = 1 / 2 * (A + B) * H)

CLS

INPUT "Enter a big base"; A

INPUT "Enter a small base"; B

INPUT "Enter a height"; H

A = 1 / 2 * (A + B) * H

PRINT "Area of trapezium"; A

END


11. Write a program to find area of sphere. (Hint: A = 4 × (22 / 7) * R^2)

CLS

INPUT "Enter a radius"; R

A = 4 * (22 / 7) * R^2

PRINT "Area of sphere"; A

END


12. Write a program to find the area of cube. (Hint: A = L^3) 

CLS

INPUT "Enter a length"; L

A = L^3

PRINT "Area of cube"; A

END


13. Write a program to find volume of box. (Hint: V = L * B * H)

CLS

INPUT "Enter a length"; L

INPUT "Enter a breadth"; B

INPUT "Enter a height"; H

V = L * B * H

PRINT "Volume of box"; V

END

14. Write a program to calculate weight from kilograms to pound. (Hint: P = K * 3.2)

CLS

INPUT "Enter a weight in kilogram"; K

P = K * 3.2

PRINT "Pound"; P

END


15. Write a program to find simple interest. (Hint: SI = (P * T * R) / 100)

CLS

INPUT "Principle"; P

INPUT "Rate"; R

INPUT "Time"; T

SI = (P * T * R) / 100

PRINT "Simple Interest"; SI

END


16. Write a program to find Amount if simple interest is given. (Hint: A = P + SI)

CLS

INPUT "Principal"; P

INPUT "Simple Interest"; SI

A = P + SI

PRINT "Amount"; A

END


17. Write a program to find the half of any number. (Hint: N = N / 2)

CLS

INPUT "Any Number"; N

H = N / 2

PRINT "Half of Number"; H

END


18. Write a program to find the square of any numbers. (Hint: Sq = N × N)

CLS

INPUT " Enter any number"; N

Sq = N × N

PRINT "Square of number"; Sq

END


19.  Write a program to find the cube of any numbers. (Hint: Cu = N × N × N)


CLS

INPUT " Enter any number"; N

Cu = N × N × N

PRINT "Cube of number"; Sq

END


20. Write a program to find perimeter of rectangle. (Hint: P = 2 * (L + B))

CLS

INPUT "Length"; L

INPUT "Breadth"; B

P = 2 * (L + B)

PRINT "Perimeter of rectangle"; P

END


21. Write a program to find the perimeter of triangle. (Hint: P = A + B + C)

CLS

INPUT "Different side of triangle"; A, B, C

P = A + B + C

PRINT "Perimeter of rectangle"; P

END


22. Write a program to find the perimeter of circle. (Hint: P = 2 * (22 / 7) * R)

CLS

INPUT "Radius"; R

P = 2 * (22 / 7) * R

PRINT "Perimeter of circle"; P

END


23. Write a program to find Sum and Difference of two number.

CLS

INPUT "Enter a 1st number"; A

INPUT "Enter a 2nd number"; B

S = A + B

D = A - B

PRINT "Sum"; S

PRINT "Difference"; D

END


24. Write a program to find the average of any two number.

CLS

INPUT "Enter 1st number"; E

INPUT " Enter 2nd number"; F

A = (E + F) / 3

PRINT "Average"; A

END


25. Write a program to find 45% and 65% of given number.

CLS

INPUT " Enter a number"; N

1N = (45 / 100) * N

2N = (65 / 100) * N

PRINT "% of Number is:"; 1N, 2N

END


26. Write a program to find volume of sphere.

CLS

INPUT "Enter a radius"; R

V = (4 / 3) * 3.14 * R^3

PRINT "Volume of sphere"; V

END


27. Write a program to find total surface area and volume of cuboid.

CLS

INPUT "Enter a length"; L

INPUT "Enter a breadth"; B

INPUT "Enter a height"; H

A = 2 * (L * B + B * H + H * L)

V = L * B * H

PRINT "Total surface area"; A

PRINT "Volume"; V

END


28. Write a program to find total surface area of cube.

CLS

INPUT "Enter side of cube"; L

T = 6 * L^2

PRINT "Total surface area"; T

END


29. Write a program to find the circumference of circle.

CLS

INPUT "Enter a radius"; R

C = 2 * 3.14 * R

PRINT "Circumference of circle"; C

END


30. Write a program to convert distance in kilometer into miles.

CLS

INPUT "Enter a Distance"; D

M = D * 0.62

PRINT "Distance in Miles"; M

END


31. Write a program to convert distance in meter into kilometer.

CLS

INPUT "Distance in meter"; M

K = M / 1000

PRINT "Kilometer"; K

END


32. Write a program to calculate potential energy of body. (Hint: PE = MGH Where G = 9.8)

CLS

INPUT "Enter a mass"; M

INPUT "Enter a height"; H

P = M * 9.8 * H

PRINT "Potential Energy"; P

END


33. Write a program to convert kilogram into grams.

CLS

INPUT "Enter value in kilogram"; K

G = K * 1000

PRINT "Value in gram"; G

END


34. Write a program to find total surface area of sphere.

CLS

INPUT "Enter radius"; R

A = 4 * 3.14 * R^2

PRINT "Total surface area"; A

END


35. Write a program to find volume of sphere.

CLS

INPUT "Enter radius"; R

V = (4 / 3) * 3.14 * R^3

PRINT "Volume of sphere"; V

END


36. Write a program to find total surface area of cylinder.

CLS

INPUT "Enter radius"; R

INPUT "Enter a height"; H

A = 2 * 3.14 * R * (R + H)

PRINT "Total surface area"; A

END


37. Write a program to calculate the distance. (Hint: S = u * t + (1 / 2) * A * T^2)

CLS

INPUT "Enter initial velocity"; U

INPUT "Enter time"; T

INPUT "Enter acceleration"; A

S = u * t + (1 / 2) * A * T^2)

PRINT "Distance Travelled"; S

END













Comments

Popular Posts