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 216 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
Gracias!


bulacsom

  • Member
  • Posts: 329
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

The effects of organophosphate poisoning are referred to by using the abbreviations “SLUD” or “SLUDGE,” It stands for: salivation, lacrimation, urination, defecation, GI upset, and emesis.

Did you know?

Symptoms of kidney problems include a loss of appetite, back pain (which may be sudden and intense), chills, abdominal pain, fluid retention, nausea, the urge to urinate, vomiting, and fever.

Did you know?

Anti-aging claims should not ever be believed. There is no supplement, medication, or any other substance that has been proven to slow or stop the aging process.

Did you know?

Over time, chronic hepatitis B virus and hepatitis C virus infections can progress to advanced liver disease, liver failure, and hepatocellular carcinoma. Unlike other forms, more than 80% of hepatitis C infections become chronic and lead to liver disease. When combined with hepatitis B, hepatitis C now accounts for 75% percent of all cases of liver disease around the world. Liver failure caused by hepatitis C is now leading cause of liver transplants in the United States.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

For a complete list of videos, visit our video library