CONVERT KILOMETER TO MILES, PAISA TO RUPEES + OTHERS



68. Input distance in kilometer and convert into miles.
REM PROGRAM TO CONVERT KILOMETER TO MILES
CLS
INPUT”ENTER DISTANCE IN KILOMETER”; K
M = K * 0.62
PRINT “DISTANCE IN MILES=”; M
END

USING SUB PROCEDURE
DECLARE SUB CONVERT(K)
CLS
INPUT”ENTER DISTANCE IN KILOMETER”; K
CALL CONVERT(K)
END

SUB CONVERT (K)
M = K * 0.62
PRINT “DISTANCE IN MILES=”; M
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION CONVERT(K)
CLS
INPUT”ENTER DISTANCE IN KILOMETER”; K
PRINT “DISTANCE IN MILES=”; CONVERT(K)
END

FUNCTION CONVERT (K)
M = K * 0.62
CONVERT = M
END FUNCTION

69. Input value in kilogram and convert into grams.
REM PROGRAM TO CONVERT VALUE IN KILOGRAM TO GRAMS
CLS
INPUT”ENTER VALUE IN KILOGRAM”; K
G = K * 1000
PRINT “VALUE IN GRAMS=”; G
END

USING SUB PROCEDURE
DECLARE SUB CONVERT(K)
CLS
INPUT”ENTER VALUE IN KILOGRAM”; K
CALL CONVERT(K)
END

SUB CONVERT (K)
G = K * 1000
PRINT “VALUE IN GRAMS=”; G
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION CONVERT(K)
CLS
INPUT”ENTER VALUE IN KILOGRAM”; K
PRINT “VALUE IN GRAMS=”; CONVERT(K)
END

FUNCTION CONVERT (K)
G = K * 1000
CONVERT = G
END FUNCTION

70. Input value in meter and convert into inch.
REM PROGRAM TO CONVERT VALUE IN METER TO INCH
CLS
INPUT”ENTER VALUE IN METER”; M
I = M * 39.37
PRINT “VALUE IN INCH=”; I
END

USING SUB PROCEDURE
DECLARE SUB CONVERT(M)
CLS
INPUT”ENTER VALUE IN METER”; M
CALL CONVERT(M)
END

SUB CONVERT (M)
I = M * 39.37
PRINT “VALUE IN INCH=”; I
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION CONVERT(M)
CLS
INPUT”ENTER VALUE IN METER”; M
PRINT “VALUE IN INCH=”; CONVERT(M)
END

FUNCTION CONVERT (M)
I = M * 39.37
CONVERT = I
END FUNCTION


71. Input selling price and cost price calculate profit or loss percentage.

REM PROGRAM TO CALCULATE PROFIT OR LOSS PERCENTAGE
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
IF CP > SP THEN
LP = ((CP - SP)/CP) * 100
PRINT "LOSS PERCENTAGE="; LP
ELSEIF SP > CP THEN
PP = ((SP - CP)/CP) * 100
PRINT "PROFIT PERCENTAGE"; PP
ELSE
PRINT "NEITHER PROFIT NOR LOSS"
END IF
END

USING SUB PROCEDURE

DECLARE SUB PP(SP, CP)
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
CALL PP(SP, CP)
END

SUB PP (SP, CP)
IF CP > SP THEN
LP = ((CP - SP)/CP) * 100
PRINT "LOSS PERCENTAGE="; LP
ELSEIF SP > CP THEN
PP = ((SP - CP)/CP) * 100
PRINT "PROFIT PERCENTAGE"; PP
ELSE
PRINT "NEITHER PROFIT NOR LOSS"
END IF
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION PP(SP, CP)
CLS
INPUT “ENTER COST PRICE”; CP
INPUT “ENTER SELLING PRICE”; SP
C = PP(SP, CP)
END

FUNCTION PP (SP, CP)
IF CP > SP THEN
LP = ((CP - SP)/CP) * 100
PRINT "LOSS PERCENTAGE="; LP
ELSEIF SP > CP THEN
PP = ((SP - CP)/CP) * 100
PRINT "PROFIT PERCENTAGE"; PP
ELSE
PRINT "NEITHER PROFIT NOR LOSS"
END IF
END FUNCTION

72. Input sales amount and rate of commission then calculate commission and return net sales. [ns=sa-c)

REM PROGRAM TO CALCULATE NET SALES
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
C = R / 100 * A
NS = A - C
PRINT “NET SALES=”; NS
END

USING SUB PROCEDURE

DECLARE SUB SALES(A, R)
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
CALL SALES (A, R)
END

SUB SALES(A, R)
C = R / 100 * A
NS = A - C
PRINT “NET SALES=”; NS
END SUB
           
USING FUNCTION PROCEDURE

DECLARE FUNCTION SALES(A, R)
CLS
INPUT “ENTER SALES AMOUNT”; A
INPUT “ENTER COMMISSION RATE”; R
PRINT “NET SALES=”; SALES (A, R)
END

FUNCTION SALES(A, R)
C = R / 100 * A
NS = A - C
SALES = NS
END FUNCTION

73. Input number as paise and convert into rupees only.

REM PROGRAM TO CONVERT PAISE INTO RUPEES
CLS
INPUT “ENTER VALUE IN PAISE”; P
R = P / 100
PRINT P; “PAISE =”; “RS.”; R
END

USING SUB PROCEDURE

DECLARE SUB CONVERT (P)
CLS
INPUT “ENTER VALUE IN PAISE”; P
CALL CONVERT (P)
END

SUB CONVERT (P)
R = P / 100
PRINT P; “PAISE =”; “RS.”; R
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION CONVERT (P)
CLS
INPUT “ENTER VALUE IN PAISE”; P
PRINT P; “PAISE =”; “RS.”; CONVERT(P)
END

FUNCTION CONVERT (IC)
R = P / 100
CONVERT = R
END FUNCTION

74. Find cost of painting the four walls of a room.

REM PROGRAM TO COST OF PAINTING THE FOUR WALLS OF  A ROOM
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
INPUT “ENTER COST OF A PAINTING”; C
A = 2 * H * (L + B)
T = C * A
PRINT “COST OF PAINTING A ROOM“; T
END

USING SUB PROCEDURE

DECLARE SUB COST (L, B, H, C)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
INPUT “ENTER COST OF A PAINTING”; C
CALL COST (L, B, H, C)
END

SUB COST (L, B, H, C)
A = 2 * H * (L + B)
T = C * A
PRINT “COST OF PAINTING A ROOM“; T
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION COST (L, B, H, C)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
INPUT “ENTER COST OF A PAINTING”; C
PRINT “COST OF PAINTING A ROOM“; COST(L, B, H, C)
END

FUNCTION COST (L, B, H, C)
A = 2 * H * (L + B)
T = C * A
COST = C
END FUNCTION

75. Solve a quadratic equation ax2+bx+c=0 on the basis of the coefficient values a, b, and c.

REM SOLVE A QUADRATIC EQUATION
CLS
INPUT "ENTER VALUE FOR A"; A
INPUT "ENTER VALUE FOR B"; B
INPUT "ENTER VALUE FOR C"; C
D = (B * B - 4 * A * C) ^ (1 / 2)
X = (-B + D) / 2 * A
Y = (-B - D) / 2 * A
PRINT "SOLUTION OF QUADRATIC EQUATION ARE"; X; Y
END

USING SUB PROCEDURE
DECLARE SUB EQUATION (A, B, C)
CLS
INPUT "ENTER VALUE FOR A"; A
INPUT "ENTER VALUE FOR B"; B
INPUT "ENTER VALUE FOR C"; C
CALL EQUATION(A, B, C)
END

SUB EQUATION (A, B, C)
D = (B * B - 4 * A * C) ^ (1 / 2)
X = (-B + D) / 2 * A
Y = (-B - D) / 2 * A
PRINT "SOLUTION OF QUADRATIC EQUATION ARE"; X; Y
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION EQUATION (A, B, C)
COMMON SHARED X
CLS
INPUT "ENTER VALUE FOR A"; A
INPUT "ENTER VALUE FOR B"; B
INPUT "ENTER VALUE FOR C"; C
PRINT "SOLUTION OF QUADRATIC EQUATION ARE"; X; EQUATION(A, B, C)
END

FUNCTION EQUATION (A, B, C)
D = (B * B - 4 * A * C) ^ (1 / 2)
X = (-B + D) / 2 * A
Y = (-B - D) / 2 * A
EQUATION =Y
END FUNCTION

76. Display sum of half of any two given numbers.

REM PROGRAM TO DISPLAY SUM OF HALF OF ANY TWO GIVEN NUMBERS
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
S = A / 2 + B / 2
PRINT “SUM OF HALF OF TWO NUMBERS”; S
END

USING SUB PROCEDURE
DECLARE SUB SUM (A, B)
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
CALL SUM(A, B)
END

SUB SUM (A, B)
S = A / 2 + B / 2
PRINT “SUM OF HALF OF TWO NUMBERS”; S
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION SUM (A, B)
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
S = SUM(A, B)
PRINT “SUM OF HALF OF TWO NUMBERS”; S
END

FUNCTION SUM (A, B)
SU =  A / 2 + B / 2
SUM = SU
END FUNCTION

77. Calculate total saving of a man if he earns Rs. 10,000 per month and spends 20% on food, 15% on children’s education, 10% on entertainment and 20% on rent.

REM CALCULATE TOTAL SAVINGS OF A MAN
CLS
LET S = 10000
F = 20 / 100 * S
C = 15 / 100 * S
E = 10 / 100 * S
R = 20 / 100 * S
T = S – (F + C + E + R)
PRINT “ TOTAL SAVING =”; T
END

USING SUB PROCEDURE
DECLARE SUB SAVING ( S)
COMMON SHARED F, C, E, R
CLS
LET S = 10000
F = 20 / 100 * S
C = 15 / 100 * S
E = 10 / 100 * S
R = 20 / 100 * S
CALL SAVING(S)
END

SUB SAVING(S )
T = S – (F + C + E + R)
PRINT “ TOTAL SAVING =”; T
END SUB

USING FUNCTION PROCEDURE
DECLARE FUNCTION SAVING ( S)
COMMON SHARED F, C, E, R
CLS
LET S = 10000
F = 20 / 100 * S
C = 15 / 100 * S
E = 10 / 100 * S
R = 20 / 100 * S
PRINT SAVING(S)
END

FUNCTION SAVING( S)
T = S – (F + C + E + R)
SAVING = T
END FUNCTION

Comments

Blog27999 said…
According to Stanford Medical, It's in fact the ONLY reason this country's women live 10 years more and weigh 42 lbs less than us.

(And actually, it has absolutely NOTHING to do with genetics or some secret exercise and absolutely EVERYTHING about "how" they are eating.)

BTW, What I said is "HOW", not "WHAT"...

Click on this link to discover if this quick test can help you decipher your real weight loss potential

Popular posts from this blog

PROGRAM TO FIND SQUARE, CUBE, SQUARE ROOT AND CUBE ROOT OF GIVEN NUMBER

PROGRAM TO DISPLAY SUM, PRODUCT, DIFFERENCE AND PRODUCT OF TWO / THREE NUMBERS

PALINDROME AND ARMSTRONG PROGRAMS