This topic contains a solution. Click here to go to the answer

Author Question: What is the printout of the following code?double x = 5.5;int y = (int)x;System.out.println("x is " ... (Read 113 times)

jeatrice

  • Hero Member
  • *****
  • Posts: 543

Question 1

Which of the following expressions will yield 0.5?
◦ 1 / 2
◦ 1.0 / 2
◦ 1 / 2.0
◦ (double) 1 / 2
◦ (double) (1 / 2)

Question 2

What is the printout of the following code?

double x = 5.5;
int y = (int)x;
System.out.println("x is " + x + " and y is " + y);

◦ x is 5 and y is 6
◦ x is 6 and y is 6
◦ x is 6.0 and y is 6.0
◦ x is 5.5 and y is 5
◦ x is 5.5 and y is 5.0


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by jeatrice on May 6, 2020

morganmarie791

  • Sr. Member
  • ****
  • Posts: 336
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




jeatrice

  • Member
  • Posts: 543
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


kishoreddi

  • Member
  • Posts: 329
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

A recent study has found that following a diet rich in berries may slow down the aging process of the brain. This diet apparently helps to keep dopamine levels much higher than are seen in normal individuals who do not eat berries as a regular part of their diet as they enter their later years.

Did you know?

Cocaine was isolated in 1860 and first used as a local anesthetic in 1884. Its first clinical use was by Sigmund Freud to wean a patient from morphine addiction. The fictional character Sherlock Holmes was supposed to be addicted to cocaine by injection.

Did you know?

Most childhood vaccines are 90–99% effective in preventing disease. Side effects are rarely serious.

Did you know?

Of the estimated 2 million heroin users in the United States, 600,000–800,000 are considered hardcore addicts. Heroin addiction is considered to be one of the hardest addictions to recover from.

Did you know?

Oliver Wendell Holmes is credited with introducing the words "anesthesia" and "anesthetic" into the English language in 1846.

For a complete list of videos, visit our video library