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


shailee

  • Member
  • Posts: 392
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

To maintain good kidney function, you should drink at least 3 quarts of water daily. Water dilutes urine and helps prevent concentrations of salts and minerals that can lead to kidney stone formation. Chronic dehydration is a major contributor to the development of kidney stones.

Did you know?

The first oncogene was discovered in 1970 and was termed SRC (pronounced "SARK").

Did you know?

Oxytocin is recommended only for pregnancies that have a medical reason for inducing labor (such as eclampsia) and is not recommended for elective procedures or for making the birthing process more convenient.

Did you know?

In most cases, kidneys can recover from almost complete loss of function, such as in acute kidney (renal) failure.

Did you know?

Asthma attacks and symptoms usually get started by specific triggers (such as viruses, allergies, gases, and air particles). You should talk to your doctor about these triggers and find ways to avoid or get rid of them.

For a complete list of videos, visit our video library