SAMPLE C++ PROGRAM's



Programming Environment

Use the g++ compiler on the Unix machines in Atanasoff.
To compile the source code use command g++ -c program name . This is will give you the object code.
To compile the source code to a binary use the command g++ -o executable_name program_name


Program I

Write a C++ program to write customer information into a random access file. The structure of the client record is as follows -
{
int acctNum;
char lastName[15];
char firstName[10];
float balance;
}
This program is similar to assignment 1.a.
click here for the source code.
click here for the text version.

Program II

Write a C++ program to read customer information from a random access file. The structure is same as the previous program. Print the info on the screen. This program is similar to assignment 1.b.
click here for the source code.
click here . for the text version.

Program III

Write a C++ program to modify customer information into a random access file. The structure is same as the previous program. Print the info on the screen. This program is similar to assignment 2.
click here for the source code.
click here . for the text version.