java programming(20p)

2014-01-07 7:09 am
Write a program which will demonstrate how to format output. To format datais to
present it in a certain way. The same data can be formatted in many ways, someof them easy for users to understand, and some of them not.This program shouldbe an example of howJava lets you format numbers and strings. First you willneed
to study Java's formatting facilities, and then writea program whichshows the
contents of variables being printed with different widths,precisions,and alignments.Your program should:
a) Print out the result of dividing 2400 by 7, rounded off to 0, 1, 2, and 3 decimalplaces.
b) Print out the result of dividing 2400by 24.
c) Show how we can left-justifya column of several rows ofnames, and then howwe can right justify them.

回答 (2)

2014-01-07 10:57 pm
✔ 最佳答案
先生,java 計數你咪set 條式落個function 度. 唔好玩野(生動物)!! 我識寫野..
2014-01-07 3:34 pm
i am not quite understanding the question c, would you mind giving more details on the subject? can you provide some samples on the names formatted?


收錄日期: 2021-04-13 19:54:12
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20140106000051KK00247

檢視 Wayback Machine 備份