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 215 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
Great answer, keep it coming :)


rachel

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

 

Did you know?

Lower drug doses for elderly patients should be used first, with titrations of the dose as tolerated to prevent unwanted drug-related pharmacodynamic effects.

Did you know?

Malaria was not eliminated in the United States until 1951. The term eliminated means that no new cases arise in a country for 3 years.

Did you know?

Hypertension is a silent killer because it is deadly and has no significant early symptoms. The danger from hypertension is the extra load on the heart, which can lead to hypertensive heart disease and kidney damage. This occurs without any major symptoms until the high blood pressure becomes extreme. Regular blood pressure checks are an important method of catching hypertension before it can kill you.

Did you know?

Adults are resistant to the bacterium that causes Botulism. These bacteria thrive in honey – therefore, honey should never be given to infants since their immune systems are not yet resistant.

Did you know?

Immunoglobulin injections may give short-term protection against, or reduce severity of certain diseases. They help people who have an inherited problem making their own antibodies, or those who are having certain types of cancer treatments.

For a complete list of videos, visit our video library