Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

/* Output Enter your street address: 127 Main Street Enter your city: Corona Ent

ID: 3649313 • Letter: #

Question

/* Output
Enter your street address: 127 Main Street
Enter your city: Corona
Enter your state (2 digits): CA
Enter your 5-digit zip code: 92123

Your full address is
127 Main Street, Corona CA 92123
Note: The entire address, including commas and spaces should be held in the c_string
named address.

Do you want to run the program again (Y/N)? n
Press any key to continue. . . */


Here are some of the things that Im looking for.

1) Declare 5 c_string, using the names and sizes listed.
- Street - size = 30 // Holds street address
- City - size = 20
- State - size = 3
- zip - size = 6
- address - size = 60

2) Use 2 functions: getInfo() and displayAddress()
- getInfo
- The function does is a void-returning function.
- This function prompts the user to enter the street address, city, state, and zip code.
- All of the inputs are assigned to c_strings, which were passed by reference to the function.
-When the program function is finished, program execution returns to main().

- In main()
- Use c_string library functions to concatenate the the held in street, city, state and zip. and assign the whole string address.

- displayAddress
- This function void-return function.
- Only one parameter, address, is passed to the function
- This function outputs the full address. (see output above)
Use the address variable containing the concatenated string and not
the variable: street, city, state and zip.

In main()
Include code to allow the user to run the program repeatedly
Prompt the user:
Do you want to run the program again?
If the user enters Y or y the screen clears and the program starts again.

Explanation / Answer

please rate - thanks

#include <iostream>
#include <cstring>
using namespace std;
void getInfo(char[],char[],char[],char[]);
void displayAddress(char[]);
int main()
{char Street[30],City[20],State[3],zip[6],address[60];
char again;
do
{system("cls");
getInfo(Street,City,State,zip);
strcpy(address,Street);
strcat (address,", ");
strcat (address,City);
strcat (address," ");
strcat (address,State);
strcat (address," ");
strcat (address,zip);
displayAddress(address);
cout<<"do it again?(Y/N)? ";
cin>>again;
}while(again=='y'||again=='Y');
return 0;
}

void getInfo(char Street[],char City[],char State[],char zip[])
{cout<<"Enter your street address: ";
cin.getline(Street,30);
cout<<"Enter your city: ";
cin.getline(City,20);
cout<<"Enter your state: ";
cin.getline(State,3);
cout<<"Enter your 5-digit zip code: ";
cin.getline(zip,6);
}
void displayAddress(char address[])
{cout<<"Your full address is ";
cout<<address<<endl;
}