Unformatted text preview:

CS 2341 Principles of Computer Science II Homework III Spring 2006 1 Define a PayRoll class that has data members for an employee s name hourly pay rate and number of hours worked The name attribute must be of type char Include a 3 argument constructor default constructor and destructor function along with the appropriate get and set functions Also include a member function that will calculate and return the total pay earned You need only show the class interface 3 points 2 Point out the syntax logical errors in each of the following code 1 points each char ptr cin getline ptr 20 char ptr C char string 15 programming strcpy ptr string char string 15 strcat string string literal Can a correct Time class definition include both of the following methods If not explain why not Time int h 0 int m 0 int s 0 Time 3 What does the following main driver display include iostream using namespace std class String private char s int length public String char void func1 char void func2 void String func1 char p char temptr temptr s length strlen p s new char length strcpy s temptr strcat s strcat s p cout s void String func2 for int I length 1 I 0 I cout s I String String char p length strlen p s new char length 1 strcpy s p cout s int main String s1 apples s1 func2 s1 func1 oranges return 0


View Full Document

SMU CSE 2341 - Study Guide

Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?