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 97 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
Gracias!


frankwu0507

  • Member
  • Posts: 322
Reply 3 on: Yesterday
Excellent

 

Did you know?

Aspirin may benefit 11 different cancers, including those of the colon, pancreas, lungs, prostate, breasts, and leukemia.

Did you know?

When blood is exposed to air, it clots. Heparin allows the blood to come in direct contact with air without clotting.

Did you know?

All adverse reactions are commonly charted in red ink in the patient's record and usually are noted on the front of the chart. Failure to follow correct documentation procedures may result in malpractice lawsuits.

Did you know?

After 5 years of being diagnosed with rheumatoid arthritis, one every three patients will no longer be able to work.

Did you know?

More than 30% of American adults, and about 12% of children utilize health care approaches that were developed outside of conventional medicine.

For a complete list of videos, visit our video library