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 96 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


Dinolord

  • Member
  • Posts: 313
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

Patients who cannot swallow may receive nutrition via a parenteral route—usually, a catheter is inserted through the chest into a large vein going into the heart.

Did you know?

Eating food that has been cooked with poppy seeds may cause you to fail a drug screening test, because the seeds contain enough opiate alkaloids to register as a positive.

Did you know?

Thyroid conditions may make getting pregnant impossible.

Did you know?

When taking monoamine oxidase inhibitors, people should avoid a variety of foods, which include alcoholic beverages, bean curd, broad (fava) bean pods, cheese, fish, ginseng, protein extracts, meat, sauerkraut, shrimp paste, soups, and yeast.

Did you know?

Vital signs (blood pressure, temperature, pulse rate, respiration rate) should be taken before any drug administration. Patients should be informed not to use tobacco or caffeine at least 30 minutes before their appointment.

For a complete list of videos, visit our video library