Question: Can anyone tell me why this code is not running in netbeans? package testlease; import java.util.Scanner; public class TestLease { /** * @param args the
Can anyone tell me why this code is not running in netbeans?
package testlease; import java.util.Scanner;
public class TestLease {
/** * @param args the command line arguments */ public static void main(String[] args) { Lease lease1 = new Lease(); Lease lease2 = new Lease(); Lease lease3 = new Lease(); Lease lease4 = new Lease(); lease1 = getData(); lease2 = getData(); lease3 = getData(); showValues(lease1); showValues(lease1); showValues(lease2); showValues(lease3); showValues(lease4); } public static void showValues(Lease lease1) { System.out.println("tenant name is. " + lease1.getName()); System.out.println("Apartment Number is. " + lease1.getApartmentNumber()); System.out.println("Your total Rent is. " + lease1.getMontlyRent()); System.out.println("Your total lease month is. " + lease1.getLease()); lease1.addPetFee(); } public static Lease getData() { Scanner inputDevice = new Scanner(System.in); Lease lease = new Lease(); System.out.println("Please Enter Name. >> "); String name = inputDevice.nextLine(); lease.setName(name); System.out.println("Please Enter Apartment Number. >> "); int apartmentNum = inputDevice.nextInt(); lease.setApartmentNumber(apartmentNum); System.out.println("Please Enter Amount of Rent. >> "); int rent = inputDevice.nextInt(); lease.setMontlyRent(rent); System.out.println("Please Enter Number of Months. >> "); int months = inputDevice.nextInt(); lease.setLease(months); return lease; }
public static void addPetFee() { int TotalRent = 1000 + 10; System.out.println(" Your Rent will be $" + TotalRent + " with the pet fee already added. "); }
private static class Lease {
public Lease() { }
private String getName() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private void setName(String name) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private void setApartmentNumber(int apartmentNum) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private void setMontlyRent(int rent) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private void setLease(int months) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private String getApartmentNumber() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private String getMontlyRent() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private String getLease() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }
private void addPetFee() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
