Saturday, August 26, 2017

QBASIC file handling programs

1. Create a sequential file "std.dat" to store name and move obtained in English ,math and science subject for few student.

-> OPEN "std.dat" FOR OUTPUT AS #1
DO
CLS
INPUT "ENTER NAME"; N$
INPUT "ENTER ENGLISH MARKS";E
INPUT "ENTER MATH MARKS"; M
INPUT "ENTER SCIENCE MARKS ";S
WRITE #1, N$, E, M, S
INPUT "DO YOU WANT TO CONTINUE";CH$
LOOP WHILE UCASE$(CH$)="Y"
CLOSE #1
END


2.A data file "INFO.INF" has numerous records in it with name, address and telephone number in each record . WAP to scan all the records from the file and display only the record with address "bhaktapur".

-> OPEN "INFO.INF' FOR INPUT AS #1
CLS
WHILE NOT EOF(1)]
INPUT #1, N$, A$, T
IF A$="bhaktapur" THEN PRINT N$, A$, T
CLOSE #1
END


3. A sequential data file "text.txt" contain student name, marks of English, math and computer. WAP to display all the records of students whose percentage is mor than 60.

-> OPEN "text.txt" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, EN, MA, CO
TO= EN+MA+CO
PR= TO/3
IF PR>60 THEN PRINT N$, EN, MA, CO
WEND
CLOSE #1
END


4. WAP to add more records in a data file "ABC.DAT" having following fields patients name, address and age.

-> OPEN "ABC.DAT" FOR APPEND AS #1
DO
CLS
INPUT "ENTER NAME";N$
INPUT "ENTER ADDRESS";A$
INPUT "ENTER AGE";A
WRITE #1, N$, A$, A
INPUT"DO YOU WANT TO CONTINUE?"; CH$
LOOP WHILE UCASE$ (CH$)="Y"
CLOSE #1
END


5. A sequential data, file "std.dat" contains name, class, roll no and address of some students. WAP to record and display only those record whose name starts with "A"

->OPEN "std.dat" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, C, R, A$
A$= UCASE$( LEFT$(N$, 1)
IF A$= "A" THEN PRINT N$, C, R, A$
WEND
CLOSE #1
END


6. WAP to store records regarding the information of book number, name, and authors  name in a sequential data.

->OPEN "LIBRARY.DAT" FOR OUTPUT AS #1
DO
CLS
INPUT" ENTER BOOK'S NUMBER";N
INPUT" ENTER BOOK'S NAME";N$
INPUT" ENTER AUTHORS NAME ";A$
WRITE #1, N, N$, A$
INPUT" DO YOU WANT TO CONTINUE?"; CH$
LOOP WHILE UCASE$(CH$)="Y"
CLOSE#1
END


7. A sequential data file called" MARKS.DAT" contains roll no, name, English, Nepali, and Math fiels. WAP to display the contents.

-> OPEN "MARKS.DAT" AS INPUT AS #1
CLS
INPUT"ROLL NO", "NAME", "ENGLISH", "NEPALI", "MATH"
WHILE NOT EOF(1)
INPUT #1, R, N$, E, N, M
PRINT R, N$, E, N, M
WEND
CLOSE #1
END


8. WAP to create sequential data file "Employee.dat" to store employee's, name, address, gender and salary.

->OPEN"Employee.dat" FOR OUTPUT AS #1
TOP:
CLS
INPUT" ENTER NAME";N$
INPUT" ENTER ADDRESS";A$
INPUT" ENTER AGE";A
INPUT" ENTER GENDER"; G$
INPUT" ENTER SALARY";S
WRITE #1, N$, A$, A, G$, S
INPUT" DO YOU WANT TO CONTINUE"; CH$
IF UCASE$(CH$)="Y" THEN GOTO TOP
END


9. A data file" LIB.TXT" contain Book's name, authors name and price of books, WAP to count and display total number of record present in a file.

->OPEN "LIB.TXT" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, B$, A$, P
C=C+1
WEND
CLOSE #1
PRINT" TOTAL NUMBER OF RECORD=";C
END


10. A sequential data file name" EMP.DAT" contain name, post, and salary fields. WAP to display all the information of employees along with 15% tax amount.

-> OPEN " EMP.DAT" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, P$,S, T
T= 15/100 *S
PRINT N$, P$, S, T
WEND
CLOSE #1
END


11.A  sequential data file called "MARKS.DAT" contain roll no, name, English, Nepali, and Math field. WAP to display all data.

-> OPEN " MARKS.DAT" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, RN, N$, E, N, M
PRINT RN, N$, E, N, M
WEND
CLOSE #1
END


12. A sequential data file called "student.dat" contain record under the field name, English, Nepali, and Computer. WAP to add some more record to some field.

-> OPEN " student.dat" FOR APPEND AS #1
CLS
TOP:
INPUT" ENTER NAME";N$
INPUT" ENTER ENGLISH";E
INPUT" ENTER NEPALI''; N
INPUT" ENTER COMPUTER";C
WRITE #1, N$, E,N,C
INPUT" DO YOU WANT TO CONTINUE"; CH$
IF UCASE$(CH$) ="Y" THEN GOTO TOP
CLOSE #1
END


13. WAP to view those records from " Emlpoyee.dat" sequential data file having employees name, department, appointment data and salary whose salary is more than Rs 5000.

-> OPEN "Employee.dat" FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, D$, A$, S
IF S>5000 THEN PRINT N$, D$, A$, S
WEND
CLOSE #1
END


14. WAP to create a data file " teldir.dat" to store name, address and telephone number according to the need of the user.

->OPEN"teldir.dat" FOR OUTPUT AS #1
DO
CLS
INPUT" ENTER NAME";N$
INPUT" ENTER ADDRESS";A$
INPUT" ENTER TELEPHONE NUMBER";T
WRITE #1, N$, A$, T
INPUT" DO YOU WANT TO CONTINUE";CH$
LOOP WHILE UCASE$(CH$) ="Y"
CLOSE #1
END


15.A sequential data file "marks.dat"; contain name, English, Nepali, Math and Science fields. WAP to display all the contents of files.

->OPEN" marks.dat" FOR INPUT AS #1
CLS
PRINT "NAME", "ENGLISH", "NEPALI", "MATHS", "SCIENCE"
WHILE NOT EOF(1)
INPUT #1, N$, E, N, M, S
PRINT N$, E, N, M, S
WEND
CLOSE #1
END


16. A data file "salary.dat" contain the information of employee whose salary is greater than 15000 and less than 40000.

-> OPEN"salary.dat" FOR INPUT AS #1
CLS
PRINT "NAME", "POST", "SALARY"
WHILE NOT EOF(1)
INPUT #1, N$, P$, S
IF S<40000 AND S>15000 THEN PRINT N$,P$,S
WEND
CLOSE #1
END


17. A sequential data file called "marks.dat" contain name, age, city and telephone fields. WAP to display all the records of that files.

-> OPEN"marks.dat" FOR INPUT AS #1
CLS
PRINT" Name", "Age", "City", "Telephone"
WHILE NOT EOF(1)
INPUT #1, N$,A,C$,T
PRINT  N$,A,C$,T
WEND
CLOSE #1
END

Saturday, August 12, 2017

my father
   
           My father name is Roshan Shrestha. He is the a marketing officer in UPs . he is very creative. he loves to write, be fit, and he is very caring. He likes to play footbal. We used to play football together.  He create a friendly environment with me. I love to say that
you work rea. lly hard to give us education and  give us a reasion to laught and You encourage me to do many thing in paricipating in any compidition and games and also  for my exam and other suffs.  he loves me and my mom and i want to say that we love you too.










Saturday, August 5, 2017

Visit to Parliament

August 4
Topic:visit to sangsad Sabha

                  On August 4 our school Jagat Mandir. H. S. B. S organized a visit to the parliament( sangsad Sabha) and a opportunity for us to how rules are made . 
      
              When we reached to the parliament we discovered a peaceful, beautiful and secured place where security was very tight. There where guards(anusasan palac) all over the place. and it was too boring watching other talk and we have to listen without making noise and making any movement for 4 hours.

Objective
            - to observe how the rules where made
            - opportunity for class 10 to visit the parliament
           -to know about the functioning procedure of parliament
           

Outcome(learning) of the visit:-
   =>To observe the parliament building session dicussion

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, ...