Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package mentormeetng2;
- import java.text.DecimalFormat;
- import java.util.Scanner;
- /**
- *
- * @author Savina
- */
- public class MentorMeetng2 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- DecimalFormat df = new DecimalFormat("#.##");
- double a = 12.00;
- double b = 12.01;
- double c = 12.56342;
- double d = 12.1;
- double e = 12.10;
- System.out.printf("%s%n", df.format(a));
- System.out.printf("%s%n", df.format(b));
- System.out.printf("%s%n", df.format(c));
- System.out.printf("%s%n", df.format(d));
- System.out.printf("%s%n", df.format(e));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement