Homework One

Due 21 April via email @ 11:59pm

Details:

  1. What is the area of a rectangle with length 11.34 and width 5.9? What is the volume of a box with length 11.34, width 5.9 and height 9.22? Please write a program to answer these questions. The numbers 11.34, 5.9, and 9.22 should only appear ONCE in your program. Please submit the source code.
  2. What is the value of 2 squared? 2 cubed? 2 to the power of 4? Write a program that prints out the value of 2 squared, 2 cubed, 2 to the power of four all the way up to 2 to the power of 10. Please submit the source code.
  3. Last year, Bob the happy fish paid 1,448 USD in taxes and had an income of 33,344 USD. What was Bob's tax rate? Write a program to calculate this and please submit the source code.
  4. What is the binary representation of 14? 27? 86?
  5. How many bits do we need to represent the number 144?
  6. How do we represent a floating point number, such as 45.66 in binary?
  7. What is the difference between a double and a float?
  8. Are doubles and floats inaccacurate? Why?
  9. How do we respresent a character in binary?
  10. What is the difference between ASCII and UNICODE?
  11. When does integer division occur? What is the result of 10/3, 4/10, and 12/5 using integer division?
  12. What does the % operator do? What is the result of 10%3, 4%10, and 12%5?
  13. What is operator precedence?
  14. What is operator associativity?
  15. When you have an equation in C that has mixed types ( integer * double or double + integer ), how does C respond?

This homework is worth 65 points.