- Convert the base 10 number 118 to base 2.
- Find the 8-bit two's complement representation of each of the following
(your answers to #1 will help):
- 118
- -118

- 118
- Convert the base 10 number 599 to base 9 two different ways:
- Using the subtraction method
- Using the division method

- Using the subtraction method
- Find the base 10 value of each of the following 8-bit two's complement
numbers:
- 11100110
- 01110100

- 11100110
- Convert the base 8 number 3275
_{8}to- base 10
- base 2 (using the special relationship between base 8 and base 2)

- base 10
- What is the largest positive base 10 integer (unsigned -- all places are
used for the number with no sign) that can be represented in four base
7 digits?
- The 8-bit two's complement representation of 107 is 01101011 and the
representation of 52 is 00110100.
- Find the 8-bit sum (two's complement) of 107 and 52.
0 1 1 0 1 0 1 1 + 0 0 1 1 0 1 0 0 ------------------ <---- your answer __________________

- Convert your answer to base 10.
- Your answer to part (b) (which would be the computer's answer) is NOT 159
(the base 10 sum of 107 and 52). What happened?

- Find the 8-bit sum (two's complement) of 107 and 52.
- Suppose
*gpa*is a variable containing the grade point average of a student. Suppose the goal of the program is to let a student know if he/she made the Dean's list (the gpa must be 3.5 or above). Write an*if... else...*statement that prints out the appropriate message (either "Congratulations -- you made the Dean's List" or "Sorry you didn't make the Dean's List"). - Complete the following program to determine the raise and new salary for
an employee by adding if ... else statements to compute the raise.
The input to the program includes the current annual salary
for the employee and a number in the range 1 - 10 indicating the performance rating
(10 is the best; 1 the worst rating). An employee with a rating of 7 or greater
will receive a 5% raise and all others will receive a 2% raise. An employee
receiving a rating of 10 will receive an extra $500.
// *********************************************************** // File: Salary.java // // Compute the raise and new salary for an employee // *********************************************************** import cs1.Keyboard; public class Salary { public static void main (String[] args) { double currentSalary; // current annual salary int rating; // performance rating double raise; // dollar amount of the raise // Get the current salary and performance rating System.out.print ("Enter the current salary: "); currentSalary = Keyboard.readDouble(); System.out.print ("Enter the performance rating: "); rating = Keyboard.readInt(); // Compute the basic raise -- Use if ... else ... // Add an extra $500 to the raise if the performance rating is 10 // (use an if with no else!) // Print the results System.out.println ("Amount of your raise: $" + raise); System.out.println ("Your new salary: $" + currentSalary + raise); } }