#include
#include
using namespace std;
struct customer{ //customer structure datatype
string name, address, city, state, zip, telephone, date;
int balance;
};
void setCustomer(customer&); //inputs customer data from user
void getCustomer(customer); //prints customer data to the screen
int main()
{
int size,action=1;
cout<<"-+- Customer Manager -+-\nHow many customers?:\t";
cin>>size;
customer*database=new customer[size];
cout<<"\n --- Created database of "< while(action!=0){ //Menu Interface Loop cout<<"-+- Menu -+-\n 0: Quit\n 1: Set a customer's
information\n 2: Display a customer's information\n\n>"; cin>>action; cout< switch(action){ case 1:{ int cnum; cout<<"customers:\n"; for(int x=0;x cout< cout<<"\ncustomer number to change:\t"; cin>>cnum; if(cnum<=size && cnum>0) setCustomer(database[cnum-1]); else cout<<"\ninvalid customer number!\n\n"; } break; case 2:{ int cnum; cout<<"customers:\n"; for(int x=0;x cout< cout<<"\ncustomer number to display:\t"; cin>>cnum; if(cnum<=size && cnum>0) getCustomer(database[cnum-1]); else cout<<"\ninvalid customer number!\n\n"; } break; default: break; } } delete[] database; return 0; } void setCustomer(customer&set) { cout<<"Enter Data for the Customer:\nName:\t\t\t"; cin>>set.name; cout<<"Address:\t\t"; cin.ignore(256,'\n'); getline(cin, set.address); cout<<"City:\t\t\t"; cin>>set.city; cout<<"State:\t\t\t"; cin>>set.state; cout<<"Zip Code:\t\t"; cin>>set.zip; cout<<"Telephone Number:\t"; cin>>set.telephone; cout<<"Date of last Payment:\t"; cin>>set.date; do{ cout<<"Account Balance:\t"; cin>>set.balance; if(set.balance<0) cout<<"Invalid Balance!\n"; }while(set.balance<0); //data validation } void getCustomer(customer get) { cout<<"\n --- Data for "< cout<<"\nAddress:\t"< cout<<"\nTelephone:\t"< cout<<"\nLast Payment:\t"< cout<<"\nAccount
balance:\t"< }
Write a program that uses a structure to store the following data about a customer account: Name Address City, sta...
Write a program that uses a class or structure to store the following data about a customer account. Name Address City, State and Zip Telephone Number Account Balance Date of Last Payment The program should use an array or vector of 10 objects. It should let the users enter data, change the contents of any element and display all the data stored in the array or vector. The program should be modular and menu driven. Validation: When the data for...
11.9: Speakers Bureau Write a program that keeps track of a speaker's bureau. The program should use a structure to store the following data about a speaker: Name Telephone Number Speaking Topic Fee Required The program should use an array of at least 10 structures. It should let the user enter 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 interface. Input Validation: When...
Write a program that keeps track of a speakers’ bureau. The program should use a structure to store the following data about a speaker: (this is in C++) Name Telephone Number Speaking Topic Fee Required The program should use a vector of structures. It should let the user enter data into the vector, change the contents of any element, and display all the data stored in the vector. The program should have a menu-driven user interface. Input Validation: When the...
Write a program (C++) that shows Game sales. The program should use a structure to store the following data about the Game sale: Game company Type of Game (Action, Adventure, Sports etc.) Year of Sale Sale Price The program should use an array of at least 3 structures (3 variables of the same structure). It should let the user enter data into the array, change the contents of any element and display the data stored in the array. The program...
Customer Accounts This program should be designed and written by a team of students. Here are some suggestions: Write a program that uses a structure to store the following information about a customer account: • Name • Address • City, state, and ZIP • Telephone number • Account balance • Date of last payment The structure should be used to store customer account records in a file. The program should have a menu that lets the user perform the following...
I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7: Customer Accounts Write a program that uses a structure to store the following data about a customer account: Customer name Customer address City State ZIP code Telephone Account balance Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the...
please write in C++ Write a program that uses a structure to store the following inventory data in a file: The data can be either read from a text file or the keyboard Item name (string) Quantity on hand(int) Wholesale cost(double) Retail Cost(double) The program should have a menu that allows the user to perform the following tasks: Add new records to the file Display any record in the file User will provide the name of the item or the...
Inventory Program (C++) Write a program that uses a structure to store the following inventory data in a file: - Item Description -Quantity on Hand -Wholesale cost -Retail cost -Date Added to Inventory The program should have a menu that allows the user to perform the following tasks: -Add new records to file -Display any record in the file -Change any record in the file Input Validation: The program should not accept quantities, or wholesale or retail costs, less than...
Write a C program Design a program that uses an array to store 10 randomly generated integer numbers in the range from 1 to 50. The program should first generate random numbers and save these numbers into the array. It will then provide the following menu options to the user: Display 10 random numbers stored in the array Compute and display the largest number in the array Compute and display the average value of all numbers Exit The options 2...
Write a menu driven program to demonstrate the use of array and switch. It must be written in C language . Here is the menu - Press 1 to add a number to the array. Press 2 to display the numbers entered in the array so far Press 3 to find the average of the numbers entered. Press 4 to exit. Option 1 - The user should be able to enter 20 numbers only. If all twenty numbers are entered...