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 98 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
Thanks for the timely response, appreciate it


okolip

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

 

Did you know?

Blood is approximately twice as thick as water because of the cells and other components found in it.

Did you know?

Patients who have undergone chemotherapy for the treatment of cancer often complain of a lack of mental focus; memory loss; and a general diminution in abilities such as multitasking, attention span, and general mental agility.

Did you know?

About 600,000 particles of skin are shed every hour by each human. If you live to age 70 years, you have shed 105 pounds of dead skin.

Did you know?

The first successful kidney transplant was performed in 1954 and occurred in Boston. A kidney from an identical twin was transplanted into his dying brother's body and was not rejected because it did not appear foreign to his body.

Did you know?

You should not take more than 1,000 mg of vitamin E per day. Doses above this amount increase the risk of bleeding problems that can lead to a stroke.

For a complete list of videos, visit our video library