Question: CPP could you provide comments also, Write a struct ADT called Person which contains string variables f irst name, last name, both initialized as an

CPP

could you provide comments also,

Write a struct ADT called Person which contains string variables f irst name, last name, both initialized as an empty string. In addition the ADT Person contains an integer variable age, initialized to zero.

Write a function called Information of type Person, which takes no input arguments. The function Information contains a variable individual of type Person, and within its own definition contains the mechanism to prompt the user to enter a first name, last name, and age, which are then stored in the variable individual

Write a main function, which uses the solutions to Problem 1 and Problem 2, and contains a variable A of type Person. In particular, A is assigned a value A = Information(); in the main function. Run the main function and, when prompted, enter the first name as Jane, last name Doe, and age 26. Then print to screen the first name, last name, and age, associated with the variable A by using the dot operator to access each component contained in the ADT Person.

Write a class Coin, with a single method called toss(). When we use the method toss() on an instance of the Coin, toss method returns an integer value of 0 or 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!