Homework One
Due 21 April via email @ 11:59pm
Details:
- 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.
- 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.
- 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.
- What is the binary representation of 14? 27? 86?
- How many bits do we need to represent the number 144?
- How do we represent a floating point number, such as 45.66 in binary?
- What is the difference between a double and a float?
- Are doubles and floats inaccacurate? Why?
- How do we respresent a character in binary?
- What is the difference between ASCII and UNICODE?
- When does integer division occur? What is the result of 10/3, 4/10, and 12/5 using integer division?
- What does the % operator do? What is the result of 10%3, 4%10, and 12%5?
- What is operator precedence?
- What is operator associativity?
- 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.