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

Author Question: Analyze the following code:int i = 3434; double d = 3434;System.out.printf("%5.1f %5.1f", i, d); (Read 221 times)

anshika

  • Hero Member
  • *****
  • Posts: 510

Question 1

The statement System.out.printf("%10s", 123456) outputs ________. (Note: * represents a space)
◦ 12345*****
◦ 123456****
◦ 23456*****
◦ ****123456

Question 2

Analyze the following code:

int i = 3434; double d = 3434;
System.out.printf("%5.1f %5.1f", i, d);

◦ The code compiles and runs fine to display 3434 3434.0.
◦ The code compiles and runs fine to display 3434.0 3434.0.
◦ i is an integer, but the format specifier %5.1f specifies a format for double value. The code has an error.


Related Topics

Need homework help now?

Ask unlimited questions for free

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

ky860224

  • Sr. Member
  • ****
  • Posts: 350
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 25% of students answer this correctly




anshika

  • Member
  • Posts: 510
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


hramirez205

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

 

Did you know?

Giardia is one of the most common intestinal parasites worldwide, and infects up to 20% of the world population, mostly in poorer countries with inadequate sanitation. Infections are most common in children, though chronic Giardia is more common in adults.

Did you know?

The familiar sounds of your heart are made by the heart's valves as they open and close.

Did you know?

As many as 20% of Americans have been infected by the fungus known as Histoplasmosis. While most people are asymptomatic or only have slight symptoms, infection can progress to a rapid and potentially fatal superinfection.

Did you know?

A seasonal flu vaccine is the best way to reduce the chances you will get seasonal influenza and spread it to others.

Did you know?

The newest statin drug, rosuvastatin, has been called a superstatin because it appears to reduce LDL cholesterol to a greater degree than the other approved statin drugs.

For a complete list of videos, visit our video library