Saturday, May 13, 2017

 (SUB PROCEDURE)


#WAP to find the volume of cylinder and hemisphere
>DECLARE SUB CYL( R, H)
  DECLARE SUB HEMI(R)
  CLS
  INPUT" ENTER RADIUS"; R
  INPUT" ENTER HEIGHT OF CYLINDER"; H
CALL CYL( R, H)
 CALL HEMMI(R)
 END

 SUB CYL (R , H)
 VOL=22/7*R^2*H
 PRINT" VOLUME OF CYLINDER ="; VOL
 END SUB

 SUB HEMI(R)
 H= 2/3*22/7*R^3
 PRINT "VOLUME OF HEMISPHERE ="; H
END SUB

#WAP to convert Nepali currency into US dollar.
 >DECLARE SUB D(NC)
  CLS
 INPUT "ENTER NEPALI CURRENCY  VALUE";NC
 CALL D (NC)
 END

 SUB D(NC)
US = NC/109
 PRINT" AMERICAN DOLLAR ="; US
 END SUB

#WAP to find area of sphere
 >DECLARE SUB AREA(R)
  CLS
 INPUT "ENTER RADIUS OF SPHERE";R
 CALL AREA (R)
 END

 SUB AREA(R)
 A= 4*22/7*R^2
 PRINT "AREA OF SPHERE=";A
 END SUB

#WAP  to convert US dollar into Nepali currency.
 > DECLARE SUB NC(US)
 CLS
 INPUT'ENTER AMERICAN DOLLAR VALUE";US
 CALL NC( US)
 END

 SUB NC (US)
 N= US*109
 PRINT 'NEPALI CURRENCY VALUE=";N
 END SUB
 
 #WAP convert area and volume of box.
 > DECLARE SUB AREA (L,B,H)
  DECLARE SUB VOLUME(L,B,H)
 CLS
 INPUT" ENTER LENGHT"; L
 INPUT" ENTER BREADTH"; B
 INPUT" ENETER HEIGHT ";H
 CALL AREA (L,B,H)
 CALL VOLUME (L,B,H)
 END

 SUB AREA (L,B,H)
 A= 2*(L*B+B*H+L*H)
 PRINT" AREA OF BOX=";A
 END SUB

 SUB VOLUME (L,B,H)
 V=L*B*H
 PRINT "VOLUME OF BOX=";V
 END SUB

# WAP to calculate total surface area of sphere.
 >DECLARE SUB TSA(R)
 CLS
 INPUT 'ENTER RADIUS";R
 CALL TSA (R)
 END

 SUB TSA(R)
 A=2*22/7*R^2
 PRINT " TOTAL SURFACE AREA OF SPHERE=";A
 END SUB

# WAP to calculate potential energyof a body
 > DECLARE SUB PTL(M,H)
 CLS
 INPUT" ENTER MASS";M
 INPUT" ENTER HEIGHT";H
 CALL PTL(M,H)
 END

 SUB PTL(M,H)
 P=M*H*9.8
 PRINT" POPTENTIAL ENERGY =";P
 END SUB

#WAP to convert Nepali currency into Indian currency. 
 > DECLARE  SUB IC(NC)
 CLS
 INPUT"ENTER NEPALI CURRENCY VALUE";NC
 CALL IC(NC)
 END

 SUB IC(NC)
 I=NC/1.6
 END SUB


 (FUNCTION PROCEDURE)


#WAP to find the volume of cylinder and hemisphere
>DECLARE FUNCTION CYL( R, H)
  DECLARE FUNCTION HEMI(R)
  CLS
  INPUT" ENTER RADIUS"; R
  INPUT" ENTER HEIGHT OF CYLINDER"; H

 END

 FUNCTION CYL (R , H)
 VOL=22/7*R^2*H
 PRINT" VOLUME OF CYLINDER ="; VOL
 END FUNCTION

 FUNCTION HEMI(R)
 H= 2/3*22/7*R^3
 PRINT "VOLUME OF HEMISPHERE ="; H
END FUNCTION

#WAP to convert Nepali currency into US dollar.
 >DECLARE FUNCTION D(NC)
  CLS
 INPUT "ENTER NEPALI CURRENCY  VALUE";NC
 END

 FUNCTION D(NC)
US = NC/109
 PRINT" AMERICAN DOLLAR ="; US
 END FUNCTION

#WAP to find area of sphere
 >DECLARE FUNCTION AREA(R)
  CLS
 INPUT "ENTER RADIUS OF SPHERE";R
END

 FUNCTION AREA(R)
 A= 4*22/7*R^2
 PRINT "AREA OF SPHERE=";A
 END FUNCTION

#WAP  to convert US dollar into Nepali currency.
 > DECLARE FUNCTION NC(US)
 CLS
 INPUT'ENTER AMERICAN DOLLAR VALUE";US
 END

 FUNCTION NC (US)
 N= US*109
 PRINT 'NEPALI CURRENCY VALUE=";N
 END FUNCTION

 #WAP convert area and volume of box.
 > DECLARE FUNCTION AREA (L,B,H)
  DECLARE FUNCTION VOLUME(L,B,H)
 CLS
 INPUT" ENTER LENGHT"; L
 INPUT" ENTER BREADTH"; B
 INPUT" ENETER HEIGHT ";H
 END

 FUNCTION AREA (L,B,H)
 A= 2*(L*B+B*H+L*H)
 PRINT" AREA OF BOX=";A
 END FUNCTION

 FUNCTION VOLUME (L,B,H)
 V=L*B*H
 PRINT "VOLUME OF BOX=";V
 END FUNCTION

# WAP to calculate total surface area of sphere.
 >DECLARE FUNCTION TSA(R)
 CLS
 INPUT 'ENTER RADIUS";R
 END

 FUNCTION TSA(R)
 A=2*22/7*R^2
 PRINT " TOTAL SURFACE AREA OF SPHERE=";A
 END FUNCTION

# WAP to calculate potential energyof a body
 > DECLARE FUNCTION PTL(M,H)
 CLS
 INPUT" ENTER MASS";M
 INPUT" ENTER HEIGHT";H
 END

 FUNCTION PTL(M,H)
 P=M*H*9.8
 PRINT" POPTENTIAL ENERGY =";P
 END FUNCTION

#WAP to convert Nepali currency into Indian currency. 
 > DECLARE  FUNCTION IC(NC)
 CLS
 INPUT"ENTER NEPALI CURRENCY VALUE";NC
 END

 FUNCTION IC(NC)
 I=NC/1.6
 END FUNCTION


SLC Examination 2073

1 Q/Ans a) -> The advantage of bus topology:- It is easy to set up computers and other devices  It requires power cable media, ...