azkiatunnisa

Untitled

Oct 26th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. public class Scanner
  2. {
  3.     // instance variables - replace the example below with your own
  4.  
  5.     /**
  6.      * Constructor for objects of class Scanner
  7.      */
  8.     public void displayMessage(String message)
  9.     {
  10.         // initialise instance variables
  11.         System.out.print(message);
  12.     }
  13.  
  14.     /**
  15.      * An example of a method - replace this comment with your own
  16.      *
  17.      * @param  y  a sample parameter for a method
  18.      * @return    the sum of x and y
  19.      */
  20.     public void displayMessageLine(String message)
  21.     {
  22.         // put your code here
  23.         System.out.println(message);
  24.     }
  25.     public void displayDollarAmount(double amount){
  26.         System.out.printf("$%,.2f",amount);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment