Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  ricky
Language: JAVA
Code:


public class Program1 
{

    public static void main(String args[]) 
         {
    
    Scanner keyboard=new Scanner(System.in);
    
    System.out.print("Enter Month:");
    
   String month = keyboard.nextLine();
        
    //double salary=keyboard.nextDouble();
    
     System.out.print("Enter Name:");
     String name = keyboard.nextLine();
     
     System.out.print("Enter Program:");
     String pro = keyboard.nextLine();
     
     System.out.print("Enter Semester:");
     int sem =keyboard.nextInt();
     
      System.out.print("Total Amount: RM ");
     double tamount = keyboard.nextDouble();
     
     System.out.print("Paid Amount: RM ");
    double paidamount = keyboard.nextDouble();
    
    double Balance=paidamount-tamount;
     System.out.print("\n-------------------------\n");
    System.out.print(" Receipt  "+month);
    
    System.out.print("\n----------------------\n");
    System.out.print(name + " - ("+pro+" - semester "+sem+" )");
     
    System.out.print("\nPayment Made RM \n"+tamount +" - RM"+paidamount);
   
    System.out.print("\nBalance : \n"+Balance);
    
    
    }  
}
Comments: