Question: Create a program that will prompt for user information for a Web site. Use a structure to store the data. The structure will need to
Create a program that will prompt for user information for a Web site. Use a structure to store the data. The structure will need to include the following items:
First Name - string
Last Name - string
Full Name - string
Birth Date - int (assume format yyyymmdd)
IsLeasingAutomobile - bool
yearlySalary - float
Create a single structure from the items listed above.
Prompt for all items except "Full Name" and load the input directly into a variable based on this structure .
After the data is loaded, pass the structure by reference to a method called "loadFullName". Inside the "loadFullName" method, load the Full Name data item with a string that is a combination of First Name, space, Last Name. The full name must be converted to uppercase. After the loadFullName has executed, display the value of all the data items in the variable structure.
Review of tasks:
a. Create User Structure
b. Assign a Variable to a User Structure
b. Load the Variable Structure Data
c. Pass the Variable Structured Data to "loadFullName"
d. Display the values of the variable structure. Note:Input for a boolean var is 0 for false and 1 for true. Adding this line to display once will help display the word false or true in the output.
std::cout << std::boolalpha;
cout << "is Leasing = " << VarStrucName.isLeasingAutomobile << endl; // will display true or false - with not 0 being true
Step by Step Solution
There are 3 Steps involved in it
Heres how you can create a program in C that fulfills the requirements specified Step 1 Define the Structure Start by defining a structure named User ... View full answer
Get step-by-step solutions from verified subject matter experts
