• Register
0 votes


I am new in programming and my syntax is not good, can anyone provide the right query to find?
Which of the following will format 12.78 to display as 12.8%?

  a. System.out.printf("%2.1d%", 12.78);

  b. System.out.printf("%.2f%%", 12.78);

  c. System.out.printf("%1.2d%", 12.78);

  d. System.out.printf("%.1f%%", 12.78);


7 5 3
5,380 points

1 Answer

0 votes


Let me try to help you with your query.

The correct answer is: 

System.out.printf("%.1f%%", 12.78);

Hope this might help you.

7 4 2
10,530 points

Related questions

0 votes
1 answer 36 views
Problem: Which of the following will open a file named MyFile.txt and allow you to read data from it? a. File file = new File("MyFile.txt"); b. Scanner inputFile = new Scanner("MyFile.txt"); c. File file = new File("MyFile.txt"); Scanner inputFile = new Scanner(file); d. PrintWriter inputFile = new PrintWriter("MyFile.txt"); Does any one know correct file name?
asked Feb 22 maddi86 5.4k points
0 votes
2 answers 40 views
Problems: Can anyone give the right solution? Which of the following commands set “other” permissions on file to r-x? chmod o=r+x file chmod o=rx file chmod o-r-w file chmod o+rx file
asked Feb 14 maddi86 5.4k points
0 votes
1 answer 14 views
Problem: Can anyone guide me what format to use when i have to display working of database on screen? The display format that you choose when working with a database object on the screen?
asked Feb 19 maddi86 5.4k points
1 vote
1 answer 26 views
Problem: Which of the following allows users to add, change, delete, or retrieve data in a database? a) Attribute generation b) Report generation tools c) Data dictionary d) Query wizard tool e) Data manipulation language
asked Mar 23 ArifulIslam 5.7k points
0 votes
2 answers 28 views
Problem: I am little bit confused, which command to used? Which command can be used to fine-tune the vsync and hsync of a video card for use in X Windows? a. vidtune b. synctune c. xvidtune d. vhtune
asked Feb 17 maddi86 5.4k points