First Lab Assignments

First Lab Assignments - CS 175 Lab Assignments - Spring...

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

View Full Document Right Arrow Icon
CS 175 Lab Assignments - Spring 2011 Assignment_3.cpp (2 points) – Due 3-04 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.
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.

This note was uploaded on 09/12/2011 for the course CS 175 taught by Professor Mike during the Spring '06 term at Golden West College.

Page1 / 2

First Lab Assignments - CS 175 Lab Assignments - Spring...

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