lab02 - 9 Enter the year you were born (using all four...

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

View Full Document Right Arrow Icon
Lab 2: Comments and Mixing Data Types Last Modified 12/17/2008 Key Concepts: comments, choosing appropriate data types, mixed output Open your Lab 1 and copy the code into a new project called yourPSUID- lab02.cpp . Add header comments to the top of the program. Begin by changing the birthday so that the name of the month is input instead of the number of the month. Adjust the output accordingly so that the birthdate is printed naturally, e.g. "November 9, 2006." Then add three new declarations (choose appropriate types): user's first name (make this size 15) user's middle initial user's last name (make this size 15 too) Then prompt the user to enter his/her name, one part at a time. Then output the user's name in a natural format and include the birthday in the same line, as demonstrated below. Include appropriate comments for your declarations and throughout your code. Sample Interaction Enter the name of the month you were born: November Enter the day of the month you were born:
Background image of page 1

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

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

Unformatted text preview: 9 Enter the year you were born (using all four digits): 2006 Enter your first name: John Enter your middle initial: A Enter your last name: Smith John A. Smith was born on November 9, 2006. Completing Your Assignment Compile and run your program. When your program runs successfully, 1. Open a copy of the provided lab report template . 2. Copy and paste the code into this new file. 3. Run your program two times to test the program. Use different inputs. Copy the output from these sample runs into the Sample Runs section of the lab report template. (Delete Output Files and continue doing so in labs until we talk about what output files are.) 4. Write a few sentences in the Discussion section noting what you've learned from this activity. In particular, where did you run into problems and how did you fix them? Also, try typing a space in the middle of someone's first name. Discuss what happens and why you think it happens in your discussion....
View Full Document

This document was uploaded on 02/10/2011.

Page1 / 2

lab02 - 9 Enter the year you were born (using all four...

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