Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. How would you write the following arithmetic expression in Java? (use Math class) (2 points) 5.5(r+2.5)2.5+t Answer: int a=6; int b=a++; System. out.println (a);
5. How would you write the following arithmetic expression in Java? (use Math class) (2 points) 5.5(r+2.5)2.5+t Answer: int a=6; int b=a++; System. out.println (a); System. out.println (b); a=6; b=++a; System. out.println (a); System. out.println (b); Answer: 7. Show the output of the following code: Explain briefly. ( 2 points) float f=12.5F; int i= (int) f; System.out.println("f is " +f); System.out.println("i is " +i); Answer: 8. Show the output of the following code: Explain briefly. ( 2 points) double amount =5; System.out.println (amount / 2) ; System.out.println((int) amount / 2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started