Here is the problem:
Write a program that uses a structure to store the following data about a customer account:
Name
Address
City, Street, and ZIP
Telephone Number
Account Balance
Date of Last Payment.
The program should use an array of at least 20 structures. It should let the user enter the data into the array, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Then, add a function to the program such that the function allows the user to search the structure array for a particular customer's account. It should accept part of the customer's name as an argument and then search for an account with a name that matches it. Display all accounts that it matches with, while if no account matches, a message should be displayed.
pls any help is appreciated.
I need helping writing a C++ program. The program is related to structured data, arrays, and function.?
Well what is asked is an array of 20 elements. That is 20 records. Each element is a strucht, so lets build the struct first
struct Record
{
char Name[30];
char City[20];
char Street[30];
char ZIP[10];
long TelephoneNumber;
double AccountBalance;
char Date[10];
};
Once you have it, you can make an arry by doing following
Record records[20];
To ask for input for the name of first record now, you can run the line
cin.getLine( records[0].name, 30, '\n');
Hope this gives you a good starting point
Reply:create a 2d dim array to store each element. like this:
john address,city, tel. acc...
mike add, city, tel, acc...
and so on. then you could access them.
array[0] would be the name, array[1] the add and so on.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment