any language Create one object – Person, and code it. Create the menus shown in the demo program. The interface is a bit different from what you have done to this point. Play with the program to see how it works. The hungarian notation for a date control is dte. Commands The key commands of this program are: Add a Person Remove a Person Display next person Display previous person Display first person Display last person.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

any language
Create one object – Person, and code it. Create the menus shown in the demo program. The interface is a bit different from what you have done to this point. Play with the program to see how it works. The hungarian notation for a date control is dte.

Commands

The key commands of this program are:

Add a Person

Remove a Person

Display next person

Display previous person

Display first person

Display last person.

Create the programming to make these components work. Refer to the power point notes for examples of how the code needs to be set up.

Protecting Data against Accidental change

Change the display to allow the user to enter data into text boxes, but protect the data from being accidentally changed by setting the ReadOnly property of the text boxes appropriately. This should be a sub. Call it as you need it. The Date has no ReadOnly property, use the Enabled property instead for this control. Use the enabled property for the Date/Time picker.

Age Calculation

Calculate the age of the individual in the Person object and display it in the age label as we change who we are looking at. The functions you need are:

Now() – gives the current date. It has several helpful properties

Month – the month of the date in the data

Day – the day of the date in the data

Year – the year of the date in the data

Remember the age depends on whether the day and month of the birthday has already occurred in the current year. The age determination should code like this:

If Birth.Month < Now.Month then

                Age = Now.Year – Birth.Year                          ‘Have had birthday

ElseIf birth.Month = Now.Month And birth.Day <= Now.Day then

                                Age = Now.Year – Birth.Year          ‘Have had birthday

Else

                Age = Now.Year – Birth.Year – 1                   ‘Haven’t had birthday yet 

End If

Where should you place this code in the Person object?

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning