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. See Section 6-13 on how to pass a parameter by reference. R eview of tasks: a. Create User Structureb. Assign a Variable to a User Structureb. Load the Variable Structure Datac. 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 tru
C++ Program
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. See Section 6-13 on how to pass a parameter by reference.
R
eview of tasks:
a. Create User Structureb. Assign a Variable to a User Structureb. Load the Variable Structure Datac. 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
Trending now
This is a popular solution!
Step by step
Solved in 2 steps