Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Exercise5_9 {
- public static double footToMeter(double foot) {
- return 0.305 * foot;
- }
- public static double meterToFoot(double meter) {
- return 3.279 * meter;
- }
- public static void main(String[] args) {
- System.out.println("Feet Meters | Meters Feet");
- System.out.println("---------------------------------------------");
- for (double i = 0; i < 10; i++) {
- double meters = footToMeter((i + 1));
- double feet = meterToFoot((20 + i * 5));
- System.out.printf(" %.1f %.3f | %.1f %.3f\n", (i + 1), meters, (20 + i * 5), feet);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement