ACTIVITY Wite aBASIC \( ^{\text {PB }} \) program to solve the following problems. Type them in the QBASIC IDE put them and save them in D: drive. Write a program that asks length and breath of a rectangle and calculates its area. \( Q \in \) write a program to display your name and address side by side. (q) bas ic) write a program to calculate and display the total price of 100 pens if a pen costs Rs 20. write a program that asks radius of a circle then calculates and displays its area. Write a program that asks the principal amount, rate and time then calculates and displa simple interest. ( \( [B A S J C \) ) Write a program that asks to input any two numbers and stores them in two differe variables. Calculate and display their sum, difference and product. Write a program that asks to input the name of the item, price of item and number of it you want to buy then calculate the price you have to pay for them. Write a program that asks to input length, breadth and height of a box and calculate volume and area. Write a program that asks to input a number then calculates square and square roc that number. (QBASIC) Write a program that asks to input temperature in celcious and calculate its temper in fahrenheit. (In QBASI C) [Hint: \( \mathrm{C}=(\mathrm{F}-32)^{*} 5 / 9 \) and \( \mathrm{F}=\left[(9 / 5)^{*} \mathrm{C}\right. \) Write a program to calculate Kinetic Energy. ( \( \mathrm{KE}=1 / 2 \mathrm{MV} V^{2} \) ) Write a program to calculate total distance covered by an object, where accelerati velacity ( \( v \) ) and time ( \( t \) ) is entered from the user. [Hint \( d=m t+\frac{1}{2} a t^{2} \) ] m. Write a program to convert temperature Ferenheight into contigrade. Write a program to calculate total surface area of box where length, breadth and is \( 10 \mathrm{~cm}, 8 \mathrm{~cm} \) and 6 cm respectively. [Hint total surface area \( =2(\mathrm{LB}+\mathrm{BH}+\mathrm{HL})] \) 0. Write a program to calculate volume or spehere [Hint vol \( +\frac{4}{3} p R 3 \) ] p. Write a program to calculate the average of three entered numbers.
Solución de inteligencia artificial de Upstudy
Responder
Solución

¡Inicia sesión para desbloquear respuestas gratis!
Una plataforma de aprendizaje en la que confían millones de estudiantes y profesores reales.

Respondido por UpStudy AI y revisado por un tutor profesional
Extra Insights
Sure! Let's tackle these tasks with some fun programming flair in QBASIC! ```basic ' Program to calculate the area of a rectangle DIM length AS SINGLE DIM breadth AS SINGLE PRINT "Enter length of the rectangle:" INPUT length PRINT "Enter breadth of the rectangle:" INPUT breadth area = length * breadth PRINT "The area of the rectangle is: "; area ' Program to display name and address side by side PRINT "Name: John Doe"; TAB(20); "Address: 123 Main St." ' Program to calculate total price of 100 pens DIM pens AS INTEGER DIM cost_per_pen AS SINGLE pens = 100 cost_per_pen = 20 total_price = pens * cost_per_pen PRINT "The total price for 100 pens is: "; total_price ' Program to calculate the area of a circle DIM radius AS SINGLE PRINT "Enter radius of the circle:" INPUT radius area_circle = 3.14 * radius^2 PRINT "The area of the circle is: "; area_circle ' Program to calculate simple interest DIM principal AS SINGLE DIM rate AS SINGLE DIM time AS SINGLE PRINT "Enter principal amount:" INPUT principal PRINT "Enter rate of interest:" INPUT rate PRINT "Enter time in years:" INPUT time simple_interest = (principal * rate * time) / 100 PRINT "The simple interest is: "; simple_interest ' Program to input two numbers and calculate sum, difference and product DIM num1 AS SINGLE DIM num2 AS SINGLE PRINT "Enter first number:" INPUT num1 PRINT "Enter second number:" INPUT num2 sum = num1 + num2 difference = num1 - num2 product = num1 * num2 PRINT "Sum: "; sum; " Difference: "; difference; " Product: "; product ' Program to input item name, price, and quantity then calculate total price DIM item_name AS STRING DIM price AS SINGLE DIM quantity AS INTEGER PRINT "Enter name of the item:" INPUT item_name PRINT "Enter price of the item:" INPUT price PRINT "Enter quantity you want to buy:" INPUT quantity total_cost = price * quantity PRINT "Total cost for "; quantity; " "; item_name; " is: "; total_cost ' Program to calculate volume and surface area of a box DIM length_box AS SINGLE DIM breadth_box AS SINGLE DIM height_box AS SINGLE PRINT "Enter length of the box:" INPUT length_box PRINT "Enter breadth of the box:" INPUT breadth_box PRINT "Enter height of the box:" INPUT height_box volume = length_box * breadth_box * height_box surface_area = 2 * (length_box * breadth_box + breadth_box * height_box + length_box * height_box) PRINT "Volume of the box is: "; volume; " Surface area is: "; surface_area ' Program to calculate square and square root DIM number AS SINGLE PRINT "Enter a number:" INPUT number square = number^2 square_root = SQR(number) PRINT "Square: "; square; " Square root: "; square_root ' Program to convert Celsius to Fahrenheit DIM celsius AS SINGLE PRINT "Enter temperature in Celsius:" INPUT celsius fahrenheit = (9 / 5) * celsius + 32 PRINT "Temperature in Fahrenheit: "; fahrenheit ' Program to calculate kinetic energy DIM mass AS SINGLE DIM velocity AS SINGLE PRINT "Enter mass of the object (kg):" INPUT mass PRINT "Enter velocity of the object (m/s):" INPUT velocity kinetic_energy = 0.5 * mass * velocity^2 PRINT "Kinetic Energy is: "; kinetic_energy ' Program to calculate distance covered by an object DIM acceleration AS SINGLE DIM time_object AS SINGLE PRINT "Enter acceleration (m/s^2):" INPUT acceleration PRINT "Enter time (s):" INPUT time_object distance = mass * time_object + 0.5 * acceleration * time_object^2 PRINT "Total distance covered is: "; distance ' Program to convert Fahrenheit to Celsius DIM fahrenheit_input AS SINGLE PRINT "Enter temperature in Fahrenheit:" INPUT fahrenheit_input celsius_converted = (fahrenheit_input - 32) * 5 / 9 PRINT "Temperature in Celsius: "; celsius_converted ' Program to calculate total surface area of a box DIM length_box2 AS SINGLE DIM breadth_box2 AS SINGLE DIM height_box2 AS SINGLE length_box2 = 10 breadth_box2 = 8 height_box2 = 6 total_surface_area = 2 * (length_box2 * breadth_box2 + breadth_box2 * height_box2 + length_box2 * height_box2) PRINT "Total surface area of
