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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started