int x = 11;
int y = 5;
double z = 13.0;
double w = 4.0;
Evaluate each of the following expressions:
x/y
x/w
(x + z)/y
(x * w)/y
x % y
x/(y-1)+z/(y-1)
_
Write a code segment that prints a message indicating whether the
String variables s1 and s2 are the same.
_
Coffee beans are $8 a pound, but there is a 10%
discount on the total order if you buy more than 5 pounds.
Write a code segment
that sets the price based on the number of pounds.
Assume that
the price and pounds can each have a fractional part.
_
Write a code segment that print the message: The value is in range
if the value of total is between 7 and 23, inclusive.
Otherwise, it does nothing.
_
Write a code segment that prompts the user for an integer
and then prints a message if the value entered was greater than 10.
_
Use a do-while to write a code segment that keeps prompting the user for an integer
until the value is greater than 10.
It then prints the last value entered.
_
Write a code segment that declares sum and sets it to the sum of the
squares of the first 100 positive integers. (Start with 1.)
_
Write a code segment that declares average and sets it
to the average of the
squares of the first 100 positive integers. (Start with 1.)