Post-Lab - Lab (11)
Class and Struct Topic Review


Let's review the information you have learned in this laboratory by answering the following questions in writing.
Collect all the answers of this postlab in a file called post-lab11.txt

Suppose we want to keep the following information for each student in the department:

ID - long integer
Phone Number - 3 pieces (area code (integer), prefix (integer), and suffix (integer))
Date of Birth - 3 pieces (month (integer), day (integer), and year (integer) )
Overall GPA - float
First Letter of Last name - char
First Letter of First Name - char

We want to assign the following values to student1 and student2, respectively:

Student1:
ID - 444444444
Phone Number (3 pieces) - 828, 888, 8888
Date of Birth (3 pieces) - 11, 21, 1985
Overall GPA - 3.45
First Letter of Last Name: T
First Letter of First Name: R

Student2:
ID - 555555555
Phone Number (3 pieces) - 828, 777, 7777
Date of Birth (3 pieces) - 9, 2, 1965
Overall GPA - 3.05
First Letter of Last Name: S
First Letter of First Name: G

1) Assuming we don't know about structures and classes, how do you assign these values to student1?  Write the program segment that declares the required variables, then assign the above values to student1:

2)Assuming we don't know about structures and classes, how do you assign the values to student1 and student2 in the same program? Write the program segment that declares the required variables, then assign the values to student1 and student2. 

As you have noticed, assigning such values to many students without packing all of this information into one variable is a very difficult task. To answer question 3 and 4, you can use classes or structures.
 

3) Rewrite the program segments for question 1) and 2), but this time use either a struct or a class (whatever you feel it is the appropriate one).

4) Write the program segment to determine which one of these students is younger.
 
 

Instructions to return your lab to the teacher: (5 points penalty if instructions are not followed appropriately)

  1. Be sure you return all the printed files where you have written all your answers. These are the answers to Ex.11.1, 11.2, 11.3 and post-lab11.txt.
  2. Transfer ONLY the source files you have written from loki to your local Windows machine and collect them in a  folder called YourLastNameLab11 (ex. AGuercioLab11). Be sure you did not copy any executable file in this folder. If you did, please remove it from the folder.
    The files to be zipped are:
    Exercise 11.1:
    ex111.cpp
    Exercise 11.2:

    ex112.cpp
    Exercise 11.3

    ex113.cpp
    PostLab
    post-lab11.txt
  3. Now exit from the folder, right click on the folder and choose WinZip--> Zip and e-mail. This action will pack your folder and attach it to an e-mail. You can use a Rar Program if you have that program instead of the Zip program.
  4. Send the e-mail to kschaffe@kent.edu with the subject CS23021 Lab 11 Submission.
  5. Send your e-mail before the deadline to receive full credit.

Congratulations! You have completed another Lab of CS I !! :-)