Assignment_3

Assignment_3 - Computer Science G175 C+ Programming...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science G175 – C++ Programming Assignment 3 Assignment_3.cpp (2 points) Create a program that calculates the age difference between two people. Use variables to accept the first name of each person, for instance FirstPersonName and SecondPersonName. Use a typedef statement to create an alias for the phrase “unsigned short int” (use the alias USHORT). Using this alias, declare two variables: USHORT FirstPersonAge; USHORT SecondPersonAge; Use std::cin and std::cout to gather information from the user and display the end results. You will also need to use if statements. A sample run is shown here: This program calculates the age difference between two people. What is the name of the first person? Tran How old is Tran? 22 What is the name of the second person? Michelle How old is Michelle? 19 Result: Tran is 3 years older than Michelle. If the two people are the same age, the result message should reflect this fact, as shown in the sample run below: This program calculates the age difference between two people. What is the name of the first person?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Assignment_3 - Computer Science G175 C+ Programming...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online