Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner; //importing scanner
- public class Main { //program begins
- public static void main(String[] args) { //main method
- Scanner input = new Scanner (System.in); //scanner declaration
- //variable declaration
- String name;
- double balance;
- //for the user to input their name and balance
- System.out.println("Please enter your name: ");
- name = input.next();
- System.out.println("Please enter your balance: $");
- balance = input.nextDouble();
- //to output the user's name and balance
- System.out.println("Customer: " +name);
- System.out.println("Total: $ " +displayAddressInfo(balance));
- } //main method ends
- public static double displayAddressInfo(double amt_due) {
- String line1 = "ABC Manufacturing", line2 = "47 Park Lane", line3 = "Omro, WI 54963";
- String message = "This bill requires immediate attention!";
- final int limit = 1000;
- if(amt_due > limit) {
- System.out.println(message);
- }
- System.out.println(line1);
- System.out.println(line2);
- System.out.println(line3);
- return amt_due;
- } //method displayAddressInfo
- } //program ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement