i know i need to post properly using (code) (block codes),, this is my understanding of that rule if i'm wrong pls teach me, i will abide. thank you
I have been trying to get this code right for 4 days, i am losing hope. i know you'll understand me. Thank you very much
import java.util.*;
class Property
{
private String ID;
private String location;
private String description;
private double weekllRentalRate;
public Property(String pID, String ploc, String pdesc, double weelyR)
{
ID = pID; /* constructor */
ploc = location;
pdesc = description;
weeklyRentalRate = double weelyR;
}
public String getID()
{
return ID;
}
public String getDescription ()
{
return description;
}
public String getLocation()
{
return location;
}
public double getweeklyRate()
{
return weeklyRetalRate;
}
public void addProperty(String pID, String ploc, String pdesc, double weelyR)
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter ID"); // addProperty method
String ID = scan.nextLine(); // I'm trying to make it work
System.out.println("Enter Location"); // on the other class ,
String location = scan.nextLine(); // main method
System.out.println("Enter Description");
String description = scan.nextLine();
System.out.println("Enter Description");
double weelyRentalRate = scan.nextDouble();
new Property("ID", "location", "description", 0.0)
}
public class Administration
{
public Static void main(String [] args)
{
Scanner scan = new Scanner(System.in);
Property[] properties = new Property[10];
int count = 0;
Property properties[count] = new Property("AP001", "2-bedroom apartment",
"Doclands", 550);
count++;
Property properties[count] = new Property("UN112", "3-bedroom unit", "Seddon",
465);
count++
Property properties[count] = new Property("ED030", "renovated Edwardian",
"Camberwell", 650);
count++
int num;
num = scan.nextInt()
if (num == 1)
properties .addProperty() // i've tried parameters but i can't get it right
else if (num == 2)
properties .startRental()
}
I don't know what value/parameter to pass on the methods from Property class to Admin class vice versa is it Array or Objects. I'm really drained.
little guidance would be really appreciated.
thank you in advance.
John
melbourne,Aus