Writing record: –

Writing record: - In the random-access file, a full record write into file instead of particular variable. Put statement is used to write a record into random access file. Syntax of the put statement is –                 Put <File Number> [,Record Number] <,Variable Name> Where file number is the number of a file that has... Continue Reading →

Advertisements

Random access file: –

Random access file: - Random access file provide an efficient way of storing and retrieving data in a such a way that records must be modify selectively. Sequential file may only we processed in sequential order. Processing begins at the first record and continues in sequence in the last record, unless the process is halted... Continue Reading →

77) An example of common dialog control?

An example of common dialog control. Before using common dialog control on the form, place a TextBox on the form and change its name to TextMessage. Insert three menus such as file menu, format menu and colors menu using menu editor dialog box. In the file menu, add three commands such as open, save as... Continue Reading →

76) Design a form and write program in visual basic for a random-access file. The random-access file name and balance. Name of this random file is customer.dat. After input records in random access file, enter customer type, customer number, name and amount from keyboard. Customer number is record number and customer type is either 1 or 2. If customer type is 1, add the amount in his balance and if customer type 2 subtract the amount from his balance?

Private Type Record     EName As String * 20     Balance As String * 5 End Type Private Sub Command1_Click()     Dim Employee As Record, CName, Check As String     Dim Amount, CT, CN, RecNo As Integer     Open "Customer.dat" For Random As #1 Len = Len(Employee)     Check = "Y"     RecNo = 0... Continue Reading →

75) Design a form and write a program in visual basic for a random-access file. Input some record in the file. Record contains name and total marks and name of this random file is marks.dat. After appending record in the file, add 10 marks in any one record in that file by calling it using get statement?

Private Type Student     SName As String * 20     TM As String * 3 End Type Private Sub Command1_Click()     Dim MyRec As Student, Check As String, RecNo, SearchNo As Integer     Open "Marks.dat" For Random Access Read Write As #1 Len = Len(MyRec)     RecNo = 0     Check = "Y"     Do... Continue Reading →

74) An example of random access file

Private Type RecordType     SName As String * 20     Tm As String * 3 End Type Private Sub Command1_Click()     Dim MyRec As RecordType, Check As String, RecNo, SearchNo As Integer     Open "Marks.dat" For Random As #1 Len = Len(MyRec)     RecNo = 1     Check = "Y"     Do While Check =... Continue Reading →

169. Write a program to demonstrate order of execution of constructor and destructor?

#include<iostream.h> #include<conio.h> int count=0; class demo { public:                 demo()                                 {                                 ++count;                                 cout<<"Constructor Is Called With Order :"<<count<<endl;                                 }                 ~demo()                                 {                                 cout<<"Destructor Is Called With Order : "<<count<<endl;                                 --count;                                 } }; void main() {                 clrscr();                 demo d1,d2,d3;                 cout<<"In Main() Function"<<endl; }

168. Write a program to initialize member variable using constructor and displaying through destructor?

#include<iostream.h> #include<conio.h> class demo {                 int x; public:                 demo()                                 {                                 cout<<"Constructor Is Called"<<endl;                                 x=7;                                 }                 ~demo()                                 {                                 cout<<"Destructor Is Called"<<endl;                                 cout<<"X = "<<x<<endl;                                 getch();                                 } }; void main() {                 clrscr();                 demo d;                 cout<<"In Main() Function"<<endl; }

167. Write a program to demonstrate destructor?

#include<iostream.h> #include<conio.h> class demo { public:                 demo()                                 {                                 cout<<"Constructor Is Called"<<endl;                                 }                 ~demo()                                 {                                 cout<<"Destructor Is Called"<<endl;                                 getch();                                 } }; void main() {                 clrscr();                 demo d;                 cout<<"In Main() Function"<<endl; }

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: