Given that all the variables referred to are declared and initialised as below:
ID: 3632049 • Letter: G
Question
Given that all the variables referred to are declared and initialised as below:double phoneWt=45.6, phoneWidth=11.1;
int screenWidth = 120, screenHeight=100;
String deviceManufacturer = "Motorola";
Evaluate each of the following Java expressions. You must assume that each expression is independent of the others.
(a) deviceManufacturer + screenHeight
(b) screenHeight /= 2
(c) (int)phoneWidth/((int)phoneWidth - 1)
(d) phoneWt - (phoneWidth + 0.9)/2.0
(e) (int)phoneWt - screenWidth / 50
(f) (double)(screenHeight / 30) + 16.0
(g) ((phoneWt > 46.5) || (screenWidth % 10 == 0) && (screenWidth < 200))
Explanation / Answer
(a) invalid operation can't be done for String & int (b) screen height has the value of 50 (c) 0 (d) 22.35 (e) 43 (f) 19.3333333333 (g) true
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.