- QBASIC Program to get the factorial of a supplied number
- QBASIC Program to display prime digits of a supplied number
- Display only Armstrong Numbers from 1 to 1000
- Display a Numeric Patter in QBASIC
- Create a data file to copy the records of all employee.
- Create a data file "Marks.dat" and store the Marks of 5 students in 3 differents subjects.
- Create a data file to display all the records of above file "Marks.dat"
- Create a data file to display the records with the students name starting with "B"
- Create a data file "Employee.dat" and store variable numbers of data of employee.
To store Code number, Name, grade,
section, address, phone number of ‘n’ number of students in a data file “
INFO.TXT”.
CLS
OPEN "INFO.TXT" FOR APPEND AS #1
INPUT "How many records do you want to enter"; H
FOR I=1 TO H
INPUT "Code Number, Name"; CN, N$
INPUT "Grade, section"; G, S$
INPUT "Address, Phone Number";A$, PN$
WRITE #1, CN, N$, G, S$, A$, PN$
NEXT I
CLOSE #1
END
To display all the records from
“INFO.TXT” where the name of the students begin with letter “A”
CLS
OPEN "INFO.TXT" FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, CN, N$, G, S$, A$, PN$
L$=LEFT$(N$,1)
IF UCASE$(L$)="A" THEN
PRINT CN, N$, G, S$, A$, PN$
END IF
WEND
CLOSE #1
END
To display all the records from
“INFO.TXT” where the address of students is “Jhapa"
CLS
OPEN "INFO.TXT" FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, CN, N$, G, S$, A$, PN$
IF UCASE$(A$)="JHAPA" THEN
PRINT CN, N$, G, S$, A$, PN$
END IF
WEND
CLOSE #1
END
#WAP to display all the contents of data file "student.dat" where fields are unknown.
CLS
OPEN "STUDENT.DAT" FOR INPUT AS #1
WHILE NOT EOF(1)
INPUT #1, RN, N$, GR, S$
PRINT RN, N$, GR, S$
WEND
CLOSE #1
END
Want to print the output in readable format, then just add a line of code.....
CLS
OPEN "STUDENT.DAT" FOR INPUT AS #1
Print "Roll No","Full Name","Grade","Section"
WHILE NOT EOF(1)
INPUT #1, RN, N$, GR, S$
PRINT RN, N$, GR, S$
WEND
CLOSE #1
END
................ try it out
DATABASE MANAGEMENT SYSTEM
1. Fill in the blanks:
a)DBMS can thus be defined as a collection of programs that enables you to store, modify, and extract information from a database.
b) A relational database is a special type of database where data is stored in a number of separate but linked tables.
c) The table design view window allows you to create tables on your own in order to have complete control over the field names, data types and field properties.
d) The caption field property used when you want to display an alternate name for the field to explain the field name.