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 285 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 :)


DylanD1323

  • Member
  • Posts: 314
Reply 3 on: Yesterday
Gracias!

 

Did you know?

Egg cells are about the size of a grain of sand. They are formed inside of a female's ovaries before she is even born.

Did you know?

Asthma-like symptoms were first recorded about 3,500 years ago in Egypt. The first manuscript specifically written about asthma was in the year 1190, describing a condition characterized by sudden breathlessness. The treatments listed in this manuscript include chicken soup, herbs, and sexual abstinence.

Did you know?

According to the National Institute of Environmental Health Sciences, lung disease is the third leading killer in the United States, responsible for one in seven deaths. It is the leading cause of death among infants under the age of one year.

Did you know?

Disorders that may affect pharmacodynamics include genetic mutations, malnutrition, thyrotoxicosis, myasthenia gravis, Parkinson's disease, and certain forms of insulin-resistant diabetes mellitus.

Did you know?

By definition, when a medication is administered intravenously, its bioavailability is 100%.

For a complete list of videos, visit our video library