cis155_Ch3_QnA


  1. QnA Ch.3, Objects, Types, and Values
  2. Credits

QnA Ch.3, Objects, Types, and Values

Ch.3.Review.12
What are typical sizes for a char, an int, and a double?
sizeof(char)
sizeof(int)
sizeof(double)
Ch.3.Review.13
What measures do we use for the size of small entities in memory, such as ints and strings?

Ch.3.Review.22
Why can conversion from double to int be a bad thing?
Ch.3.3 TRY THIS Part 1
Modify chapter_3_3_first.cpp (download) to write out the age in months. Read the input in years and multiply it by 12.

 

Ch.3.3 TRY THIS Part 2
Read age as double (for children who can be very proud of being five and a half years old rather than just five.)

 

Ch.3.4 TRY THIS
Modify chapter_3_4_floats.cpp (download) to read an int rather than a double. Have this program verify that
  • 
        a / b * b + a % b == a
    
    

 

Ch.3.7 TRY THIS
Compile chapter_3_7.cpp (download) and examine the error messages. Provide examples of the error messages your compiler generates. Explain how error messages change when fix the coding problems one by one.

 

Ch.3 Drill.1
Modify chapter_3_1.cpp (download) as instructed. Provide your entire solution in the space below:

 

Ch.3 Drill.3
Modify chapter_3_1.cpp (download) as instructed. Provide your entire solution in the space below:

 

Ch.3 Drill.4
Modify chapter_3_1.cpp (download) as instructed. Provide your entire solution in the space below:

 



Credits