QBASIC Program To Find The Simple Interest

 QBASIC Program To Find The Simple Interest

QBASIC Program To Find The Simple Interest



Algorithm To Find The Simple Interest


Step1: Start
Step2: Accept/Input principal, time and rate and store them in different variables P, T, R
Step3: Calculate simple interest = (P*T*R)/100
Step4: Display the simple interest
Step5: End the program

QBASIC Program To Find The Simple Interest

CLS

INPUT “Enter Principal; P

INPUT “Enter Time”; T

INPUT “Enter rate”; R

Interest = (P* T * R) / 100

PRINT “The simple interest is =”; Interest

END

 Algorithm To Find The Simple Interest Using Sub Procedure in QBASIC


Step1: Start
Step2: Declare the sub procedure with a name and parameters as INTEREST (P, T, R)
Step3: Accept/Input principal, time and rate and store them in different variables P, T, R
Step4: Call the sub procedure declared in the step2 with CALL statement as CALL INTEREST (P, T, R)
Step5: End the program
Step6: Define the sub procedure
Step7: In the sub procedure, calculate the simple interest
Step8: Display the simple interest
Step9: End the sub procedure
 

 QBASIC Program To Find The Simple Interest USING SUB PROCEDURE


DECLARE SUB INTEREST (P, T, R)

CLS

INPUT “Enter Principal; P

INPUT “Enter Time”; T

INPUT “Enter rate”; R

CALL INTEREST(P, T, R)

END 

SUB INTEREST (P, T, R)

Interest = (P* T * R) / 100

PRINT “The simple interest is  =”; Interest

END SUB

 

Algorithm To Find The Simple Interest Using Function Procedure in QBASIC

Step1: Start
Step2: Declare the function procedure with name and parameters as INTEREST (P, T, R)
Step3: Declare the sub procedure with a name and parameters as INTEREST (P, T, R)
Step4: Call the function procedure declared in the step2 with a variable or PRINT Statement
Step5: End the program
Step6: Define the function procedure
Step7: In the function procedure, calculate the simple interest
Step8: Assign the value of simple interest to the function name
Step9: End the function procedure

QBASIC Program To Find The Simple Interest USING FUNCTION PROCEDURE

 

DECLARE FUNCTION INTEREST (P, T, R)

CLS

INPUT “Enter Principal; P

INPUT “Enter Time”; T

INPUT “Enter rate”; R

PRINT “The simple interest is =”; INTEREST(P, T, R)

END 

FUNCTION INTEREST (P, T, R)

I = (P* T * R) / 100

INTEREST = I

END FUNCTION

 

Comments