C Please help stuck on part 3 of project Thank you For this

****C++**** Please help stuck on part 3 of project Thank you!!

For this part of the project, you will add the functionality to translate a complete phone word into a phone number and the functionality to process a data file containing multiple records. You will also modify your input validation code to give the user an unlimited number of chances to enter valid responses. Your program should continue to run until the user chooses a “quit” option from your menu.

Instructions:

Add an option to the menu to offer the user a choice of processing a data file. Add another option to quit the program. The menu should be the first thing displayed when your program begins executing. The menu format should match the one in the Sample Output on page 3.

Allow the user to continue making menu choices until they choose the option to quit. Always display the menu before prompting the user for a menu option. Properly handle an invalid menu choice. The user should have an unlimited number of chances to enter a valid menu choice.

Modify the code you wrote in Project 2 to validate the user’s input for payment amount to allow user an unlimited number of chances to enter a valid payment amount.

Modify the code you wrote in Project 2 to translate a single letter into a telephone digit. Your code should now be able to efficiently translate a complete phone word into a phone number (no code duplication). See example below.

RAD-CODE or rad-code translate to 723-2633

HINT: Use the string class member functions at() and length(). See code example on Moodle.

If the user does not enter a phone word of the correct length, then your program should display a descriptive error message and give unlimited number of chances to enter a word of the correct length.

If any of the phone letters cannot be translated into numeric digits, instead of displaying an error message like you did in Project 2, your code should now use an asterisk (*) for the digit.

Add functionality to create and display telephone bills by reading input from the TelephoneData.txt text file. When the user selects the option to process a data file, telephone bills should be created and displayed for every record in the file without the user needing to do anything else. The TelephoneData .txt file contains 5 records, but your program must be able to process an identically formatted file with any number of records without counting the records. You do not need to process payment information if this option is chosen by the user.

Follow all the instructions above. Add functionality to verify that the phone word entered by the user only contains valid letters. If it doesn\'t, then a descriptive error message should display and the user should be given an unlimited number of chances to enter a phone word that only contains valid letters. You must follow all these instructions to receive full credit.

****** LINK FOR TelephoneData.txt***** https://moodle.cpcc.edu/pluginfile.php/1098482/mod_assign/intro/TelephoneData.txt

******SAMPLE ENDING OUTPUT*********

Welcome to the Cellular Telephone System

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 2

Enter the phone word: Rad-Code

Rad-Code translates to 723-2633

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 3

Leslie Knope

1456 Plymouth Street

Pawnee, IN 47408
Amount Owed: $23.40

Tom Haveford

689 Lil Sebastian Avenue

Pawnee, IN 47408
Amount Owed: $10.00

April Ludgate

1123 9th Avenue

Wamapoke, IN 48034
Amount Owed: $12.00

Jery Gergich
3124 Woodbridge Road

Eagleton, IN 47322
Amount Owed: $75.60

Donna Meagle

1200 Elysian Fields Blvd

Eagleton, IN 47322
Amount Owed: $49.00

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 44

44 is not a valid choice

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 4

Thank you. Closing program.

********** EXISTING CODE**********

#include
#include
#include
using namespace std;

//named constants
const int base = 50;
const float perMin = 0.20;

int main()
{
std::string name,addr,city,state, letter;
int pin,min,amount,dollars,quaters,temp,sub,dimes,nickels,pennies;
double owed;
int ch;
//menu options
std::cout<<\"Welcome to the Cellular Telephone System\"< std::cout<<\"1- Process Telephone Bill\"< std::cout<<\"2- Translate Phone Word\"< std::cout<<\"Enter your choice:\\t\";
std::cin>>ch;
cin.ignore();
switch(ch){
case 1:
std::cout<<\"Enter the name of Customer:\\t\";
std::getline(std::cin,name);
cin.clear();
std::cout<<\"Enter Street Address:\\t\";
std::getline(std::cin,addr);
cin.clear();
std::cout<<\"Enter City:\\t\";
std::getline(std::cin,city);
cin.clear();
std::cout<<\"Enter state:\\t\";
std::getline(std::cin,state);
cin.clear();
std::cout<<\"Enter zip code:\\t\";
std::cin>>pin;
std::cout<<\"Enter the number of minutes used:\\t\";
std::cin>>min;
//new rates
if(min<50){
owed = base;
}
else{
owed = base;
min= min -50;
owed+=(double)min*perMin;
}
// owed=(double)min*0.20;
std::cout<

****C++**** Please help stuck on part 3 of project Thank you!!

For this part of the project, you will add the functionality to translate a complete phone word into a phone number and the functionality to process a data file containing multiple records. You will also modify your input validation code to give the user an unlimited number of chances to enter valid responses. Your program should continue to run until the user chooses a “quit” option from your menu.

Instructions:

Add an option to the menu to offer the user a choice of processing a data file. Add another option to quit the program. The menu should be the first thing displayed when your program begins executing. The menu format should match the one in the Sample Output on page 3.

Allow the user to continue making menu choices until they choose the option to quit. Always display the menu before prompting the user for a menu option. Properly handle an invalid menu choice. The user should have an unlimited number of chances to enter a valid menu choice.

Modify the code you wrote in Project 2 to validate the user’s input for payment amount to allow user an unlimited number of chances to enter a valid payment amount.

Modify the code you wrote in Project 2 to translate a single letter into a telephone digit. Your code should now be able to efficiently translate a complete phone word into a phone number (no code duplication). See example below.

RAD-CODE or rad-code translate to 723-2633

HINT: Use the string class member functions at() and length(). See code example on Moodle.

If the user does not enter a phone word of the correct length, then your program should display a descriptive error message and give unlimited number of chances to enter a word of the correct length.

If any of the phone letters cannot be translated into numeric digits, instead of displaying an error message like you did in Project 2, your code should now use an asterisk (*) for the digit.

Add functionality to create and display telephone bills by reading input from the TelephoneData.txt text file. When the user selects the option to process a data file, telephone bills should be created and displayed for every record in the file without the user needing to do anything else. The TelephoneData .txt file contains 5 records, but your program must be able to process an identically formatted file with any number of records without counting the records. You do not need to process payment information if this option is chosen by the user.

Follow all the instructions above. Add functionality to verify that the phone word entered by the user only contains valid letters. If it doesn\'t, then a descriptive error message should display and the user should be given an unlimited number of chances to enter a phone word that only contains valid letters. You must follow all these instructions to receive full credit.

****** LINK FOR TelephoneData.txt***** https://moodle.cpcc.edu/pluginfile.php/1098482/mod_assign/intro/TelephoneData.txt

******SAMPLE ENDING OUTPUT*********

Welcome to the Cellular Telephone System

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 2

Enter the phone word: Rad-Code

Rad-Code translates to 723-2633

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 3

Leslie Knope

1456 Plymouth Street

Pawnee, IN 47408
Amount Owed: $23.40

Tom Haveford

689 Lil Sebastian Avenue

Pawnee, IN 47408
Amount Owed: $10.00

April Ludgate

1123 9th Avenue

Wamapoke, IN 48034
Amount Owed: $12.00

Jery Gergich
3124 Woodbridge Road

Eagleton, IN 47322
Amount Owed: $75.60

Donna Meagle

1200 Elysian Fields Blvd

Eagleton, IN 47322
Amount Owed: $49.00

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 44

44 is not a valid choice

1 – Process Telephone Bill

2 – Translate Phone Word

3 – Process a Data File

4 - Quit

Enter your choice: 4

Thank you. Closing program.

********** EXISTING CODE**********

#include
#include
#include
using namespace std;

//named constants
const int base = 50;
const float perMin = 0.20;

int main()
{
std::string name,addr,city,state, letter;
int pin,min,amount,dollars,quaters,temp,sub,dimes,nickels,pennies;
double owed;
int ch;
//menu options
std::cout<<\"Welcome to the Cellular Telephone System\"< std::cout<<\"1- Process Telephone Bill\"< std::cout<<\"2- Translate Phone Word\"< std::cout<<\"Enter your choice:\\t\";
std::cin>>ch;
cin.ignore();
switch(ch){
case 1:
std::cout<<\"Enter the name of Customer:\\t\";
std::getline(std::cin,name);
cin.clear();
std::cout<<\"Enter Street Address:\\t\";
std::getline(std::cin,addr);
cin.clear();
std::cout<<\"Enter City:\\t\";
std::getline(std::cin,city);
cin.clear();
std::cout<<\"Enter state:\\t\";
std::getline(std::cin,state);
cin.clear();
std::cout<<\"Enter zip code:\\t\";
std::cin>>pin;
std::cout<<\"Enter the number of minutes used:\\t\";
std::cin>>min;
//new rates
if(min<50){
owed = base;
}
else{
owed = base;
min= min -50;
owed+=(double)min*perMin;
}
// owed=(double)min*0.20;
std::cout<

Solution

#include #include #include #include #include #include #include #include // #### Bill Center ####class bill{ char cno[5]; char bdate[8]; char dueamt[6]; char oamt[6]; char duedate[8]; public: void assign(); void putdata(); char* cus(){return cno;} void billupdate(char* cusno,char* outamt,char* damt,char* billd,char* dued) { strcpy(cno,cusno); strcpy(oamt,outamt); strcpy(dueamt,damt); strcpy(bdate,billd); strcpy(duedate,dued); } }; void bill:: assign() { cout<<\"\ Enter customer no.:\"; cin>>cno; cout<<\"\ Enter bill date:\"; cin>>bdate; cout<<\"\ Enter due amount:\"; cin>>dueamt; cout<<\"\ Enter outstanding amount:\"; cin>>oamt; cout<<\"\ Enter duedate:\"; cin>>duedate; } void bill::putdata() { cout<<\"\ Customer No.: \"<>choice; switch (choice){ case 1://New Record rec.assign(); cin.get(ch); file.write((char *)&rec, sizeof(rec)); break; case 2://Display All Records file.seekg(0,ios::beg); cout<<\"\ \ Records in Bill Centre\ \"; while(file){ file.read((char *)&rec, sizeof(rec)); if (!file.eof()) rec.putdata(); } file.clear(); getch(); break; case 3://Search Bill Details when customer no.is known. cout<<\"\ \ Enter Customer No.: \"; cin>>cusno; file.seekg(0,ios::beg); found=0; while(file.read((char *)&rec, sizeof(rec))) { if(strcmp(cusno,rec.cus())==0) { found=1; rec.putdata(); } } file.clear(); if(found==0) cout<<\"\ ---Record Not Found---\ \"; getch(); break; case 4://Update Bill Details. cout<<\"\ \ Enter Customer No.: \"; cin>>cusno; file.seekg(0,ios::beg); found=0; int cnt=0; while(file.read((char *)&rec, sizeof(rec))) { cnt++; if(strcmp(cusno,rec.cus())==0) { found=1; break; } } file.clear(); if(found==0) cout<<\"\ \ ---Record Not Found---\"; else { int location=(cnt-1) * sizeof(rec); cin.get(ch); if(file.eof()) file.clear(); cout<<\"\ Enter new Bill Date: \"; cin>>billd; cout<<\"\ Enter new Due Date: \"; cin>>dued; cout<<\"\ Enter new Due Amt.: \"; cin>>damt; cout<<\"\ Enter new Outstanding Amt.: \"; cin>>outamt; file.seekp(location); rec.billupdate(cusno,outamt,damt,billd,dued); file.write((char *)&rec, sizeof(rec)); file.flush(); } break; case 5://Exitgotoout; } } out: file.close(); } // #### Telephone Directory ####class phoneBook{ char name[20],phno[6]; public: void getdata(); void showdata(); char *getname(){ return name; } char *getphno(){ return phno; } void update(char *nm,char *telno){ strcpy(name,nm); strcpy(phno,telno); } }; void phoneBook :: getdata(){ cout<<\"\ Enter Name : \"; cin>>name; cout<<\"Enter Phone No. : \"; cin>>phno; } void phoneBook :: showdata(){ cout<<\"\ \"; cout<>choice; switch(choice){ case 1 : //New Record rec.getdata(); cin.get(ch); file.write((char *) &rec, sizeof(rec)); break; case 2 : //Display All Records file.seekg(0,ios::beg); cout<<\"\ \ Records in Phone Book\ \"; while(file){ file.read((char *) &rec, sizeof(rec)); if(!file.eof()) rec.showdata(); } file.clear(); getch(); break; case 3 : //Search Tel. no. when person name is known. cout<<\"\ \ Enter Name : \"; cin>>nm; file.seekg(0,ios::beg); found=0; while(file.read((char *) &rec, sizeof(rec))) { if(strcmp(nm,rec.getname())==0) { found=1; rec.showdata(); } } file.clear(); if(found==0) cout<<\"\ \ ---Record Not found---\ \"; getch(); break; case 4 : //Search name on basis of tel. no cout<<\"\ \ Enter Telephone No : \"; cin>>telno; file.seekg(0,ios::beg); found=0; while(file.read((char *) &rec, sizeof(rec))) { if(strcmp(telno,rec.getphno())==0) { found=1; rec.showdata(); } } file.clear(); if(found==0) cout<<\"\ \ ---Record Not found---\ \"; getch(); break; case 5 : //Update Telephone No. cout<<\"\ \ Enter Name : \"; cin>>nm; file.seekg(0,ios::beg); found=0; int cnt=0; while(file.read((char *) &rec, sizeof(rec))) { cnt++; if(strcmp(nm,rec.getname())==0) { found=1; break; } } file.clear(); if(found==0) cout<<\"\ \ ---Record Not found---\ \"; else { int location = (cnt-1) * sizeof(rec); cin.get(ch); if(file.eof()) file.clear(); cout<<\"Enter New Telephone No : \"; cin>>telno; file.seekp(location); rec.update(nm,telno); file.write((char *) &rec, sizeof(rec)); file.flush(); } break; case 6 ://Exitgotoout; } } out: file.close(); } void main() { int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, \"c:\\\\tc\\\\bgi\"); setcolor(BLUE); for(int i=300,j=240;i>=20;i--,j++) { cleardevice(); rectangle(i,i,j,j); delay(7); } settextstyle(10,0,5); cleardevice(); rectangle(20,20,600,450); delay(100); outtextxy(60,200,\"W \");delay(80); for(i=0;i<1;i++) { for(int j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(150,200,\"E \");delay(80); for(i=0;i<1;i++) { for(j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(210,200,\"L \");delay(80); for(i=0;i<1;i++) { for(j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(270,200,\"C \");delay(80); for(i=0;i<1;i++) { for(j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(330,200,\"O \");delay(80); for(i=0;i<1;i++) { for(j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(390,200,\"M \");delay(80); for(i=0;i<1;i++) { for(j=100;j<500;j=j+50) {sound(j);delay(100);nosound();} } outtextxy(450,200,\"E \"); getch(); closegraph(); clrscr(); int choice; do{ cout<<\"\ ****** TELEPHONE INFORMATION CENTER ******\"; cout<<\"\ \ 1. Telephone Directory\"; cout<<\"\ 2. Bill Center\"; cout<<\"\ 3. Exit\"; cout<<\"\ Enter your choice\"; cin>>choice; { if(choice==1) readphone(); elseif(choice==2) readbill(); else exit(0); } } while(choice!=3); getch(); }
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i
****C++**** Please help stuck on part 3 of project Thank you!! For this part of the project, you will add the functionality to translate a complete phone word i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site