Docsity

5 Questions on Arithmetic Operators in Java - Homework | ITK 168.00, Assignments of Information Technology

Toggle sidebar
bg1
ITK 168
Califf
Fall, 2004
Reading Assignment for September 1, 2004
Lewis and Loftus, 2.4-2.6
1. What are the 5 arithmetic operators in Java and what does each mean?
2. What is the difference between 3/2 and 3.0/2.0?
3. What is the value of count at the end of each of the following Java statements
assuming that the statements are executed in order?
int count = 5, total = 3;
count = total + 2 * 4;
count++;
count += 2;
4. What is a widening conversion?
5. Write Java code to request and read a user’s name and then print a greeting to the
user (by name).

Partial preview of the text

Download 5 Questions on Arithmetic Operators in Java - Homework | ITK 168.00 and more Assignments Information Technology in PDF only on Docsity!

ITK 168

Califf Fall, 2004 Reading Assignment for September 1, 2004 Lewis and Loftus, 2.4-2.

  1. What are the 5 arithmetic operators in Java and what does each mean?
  2. What is the difference between 3/2 and 3.0/2.0?
  3. What is the value of count at the end of each of the following Java statements assuming that the statements are executed in order? int count = 5, total = 3; count = total + 2 * 4; count++; count += 2;
  4. What is a widening conversion?
  5. Write Java code to request and read a user’s name and then print a greeting to the user (by name).