I was wondering if you’d be able to help me with some Java Programming problems.
ID: 3771248 • Letter: I
Question
I was wondering if you’d be able to help me with some Java Programming problems.
. What are the values of variables a, b, c, and d at Reference Point 1? i publ1c class BooleanErpressions a public static void nain(String args) boolean P true boolean false boolean R - P II !Q; int x-17 boolean a P & boolean b _ (P &Q) 11 (X > 10) boolean c-P (!R) boolean d-!!Q /I Reference Point 1 5. Answer the question below about this method definition: i publ1c static void d1splay (double x. char c) a int y-xx Systen.out println(c); else ifExplanation / Answer
Output of the first program:
Value of 'a' is False since p&&q = true && false = false.
Value of 'b' is True since p&&q || x>10 = false || true = true.
Value of 'c' is False since p && ( q || !r ) = true && ( false || false ) = false.
Value of 'd' is False since !!q = !! false = false.
Output of the second program:
For the method display( 2.0, 'A' ) is A. since y>x.
For the method display( 0.5, '8' ) is error because second argument should be character.
For the method display( 0.1, 'A' ) is found on 'A', 0.01 is less than 0.1.
For the method display( 0.0, 'D' ) is does not print anything because we can not say 0.0 > 0.0 or 0.0 < 0.0. It shows an error.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.