1. Write two different Java statements that each compute the cube of an integer x. 2. Classify each of the following Java statements as either legal or illegal. Let b, s, i, l, f, and d represent...


1. Write two different Java statements that each compute the cube of an integer x.


2. Classify each of the following Java statements as either legal or illegal. Let b, s, i, l, f, and d represent variables of type byte, short, int, long, float, and double, respectively.


a. d = l;


b. l = f;


c. i = b;


d. i = s;


e. b = s;


f. i = d;


3. What is the data type of each of the following expressions if i, l, f, and d represent variables of type int, long, float, and double, respectively?


a. f + d


b. d * i


c. l – i


d. i / f


e. l % d


f. l * l



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here