Posts

File Handling in QBasic

Image
Q. WAP to store employee's id, name, post and department in a data file EMPINFO.DAT 1. OPEN "EMPINFO.DAT" FOR OUTPUT AS #1    TOP:    CLS    INPUT "ENTER ID";I    INPUT "ENTER NAME"; IN$    INPUT "ENTER POST"; P$    INPUT "ENTER DEPARTMENT";D$    WRITE #1,I,IN$, P$, D$    INPUT "DO YOU WANT TO CONTINUE? Y/N";CH$    IF UCASE$(CH$)="Y" THEN GOTO TOP    CLOSE #1    END Q. WAP to write seven customer's name, address, product name and price in sequential data file "product.txt" 2. OPEN "product.txt" FOR OUTPUT AS #1    FOR I = 1 TO 7    CLS    INPUT "ENTER CUSTOMER'S NAME"; N$    INPUT "ENTER ADDRESS"; A$    INPUT "ENTER PRODUCT'S NAME"; P$    INPUT "ENTER PRICE" ; P    WRITE #1, N$,A$,P$,P    NEXT I    CLOSE #1    END Q. WAP to store the information o...

About Grade Ten’s Visit to Legislative Parliament

Image
When I woke up on 4th August 2017, I felt a sense of anticipation within me which was comparable to anticipation that a child has for its birthday. The visit to Parliament was more like a treat to us. We were having a day off from our school and visiting a decisive place for Nepal’s future. Fast forward to 11 o’clock and we all were excited to have our first look of Parliament’s inside. 29 students and 3 teachers gathered up and lined up to have a school bus’s ride towards Mid-Baneshwor. The dusty and pit full roads retarded our journey. We entered the Parliament's territory from gate number 3. Surpassing through 4 security checks (i.e. entrance gate, metal detector, another metal detector and full body check by security personnel’s) we were now inside the building. We were escorted from entrance gate to parapet by two of the security personnel’s in a very strict manner. We were told to control our human emotions like laughing, yawning and tapping feet. We were also ins...

REPORT ON "Monsoon Hiking To Bishnudwar"

Image
Title :Relation Between Bishnudwar And Kathmandu's Life Introduction : Jagat Mandir Schhol had organized this educational trip to Bishnudwar for Grade X students. SNNP is the prime source of drinking water for Kathmandu valley. Small rivers and streams discharge about 30 million liters of water per day. The major sources include Nagmati, Bagmati, Syalmati, Bishnumati and their tributaries. Drinking water, irrigation, holy bathing are the major uses of the rivers. We visited the area and came up with this report. Objectives of the visit : * To know about the origin of Bishnumati River                                        * To know about the biodiversity within Kathmandu valley                                        * To know about the actions taken for preservation of river Metho...

Operation on Digits with SUB and FUNCTION Procedure

1. WAP to find the sum of digits. => DECLARE SUB SUM(N)      CLS      INPUT "ENTER ANY NUMBER";N      CALL SUM(N)      END      SUB SUM(N)      S = 0      WHILE N<>0      R = N MOD 10      S  = S + R      N = N \ 10      WEND      PRINT "SUM OF DIGITS = "; S      END SUB =>DECLARE FUNCTION SUM(N)      CLS      INPUT "ENTER ANY NUMBER"; N      PRINT "SUM OF DIGITS = "; SUM(N)      END      FUNCTION SUM(N)      S = 0      WHILE N<>0      R = N MOD 10      S= S+R      N = N \10      WEND      SUM = S      END FUNCTION ____________________________...

SUB PROCEDURE AND FUNCTION PROCEDURE IN USE

* 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 HEMI(R)    END    SUB CYL(R, H)    VOL1 = 22/7*R^2*H    PRINT " VOLUME OF CYLINDER = " VOL1    END SUB    SUB HEMI(R)    VOL2 = 2/3*22/7*R^3    PRINT "VOLUME OF HEMISPHERE = "; VOL2    END SUB > DECLARE FUNCTION CYL(R, H)    DECLARE FUNCTION HEMI (R)    CLS    INPUT "ENTER RADIUS "; R    INPUT "ENTER HEIGHT OF CYLINDER"; H    PRINT "VOLUME OF CYLINDER = " ; CYL(R,H)    PRINT "VOLUME OF HEMISPHERE = "; HEMI(R)    END    FUNCTION CYL(R, H)    CYL = 22/7*R^2*H    END FUNCTION    FUNCTION HEMI(R)  ...