So i have 4 classes of a car The Engine, The transmission, The Chassis and the Car itself each are coded as follows:
public class Chassis {
public double m_Cprice;
public Chassis(double m_Cprice) {
this.m_Cprice = m_Cprice;
}
public double getChassisPrice() {
return m_Cprice;
}
public void setChassisPrice(double m_Cprice){
this.m_Cprice = m_Cprice;
}
}
For the Chassis:
public class Transmission {
public double m_Tprice;
public Transmission(double m_Tprice){
this.m_Tprice = m_Tprice;
}
public double getTransmissionPrice() {
return m_Tprice;
}
public void setTransmissionPrice(double m_Tprice){
this.m_Tprice = m_Tprice;
}
}
For the Engine:
public class Engine {
public double m_Eprice;
public Engine(double m_Eprice){
this.m_Eprice = m_Eprice;
}
public double getEnginePrice() {
return m_Eprice;
}
public void setEnginePrice(double m_Eprice){
this.m_Eprice = m_Eprice;
}
}
And finally for the Car:
public final class Car {
public double m_baseprice;
public Chassis m_Cprice;
public Engine m_Eprice;
public Transmission m_Tprice;
public double getBaseprice() {
return m_baseprice;
}
public void setBasePrice(double m_baseprice){
this.m_baseprice = m_baseprice;
}
public Car(double Baseprice,double Chassis, double Engine, double Transmission) {
setBasePrice(Baseprice);
m_Cprice = new Chassis(Chassis);
m_Eprice = new Engine(Engine);
m_Tprice = new Transmission(Transmission);
}
public Chassis getM_Cprice() {
return m_Cprice;
}
public void setM_Cprice(Chassis m_Cprice) {
this.m_Cprice = m_Cprice;
}
public Engine getM_Eprice() {
return m_Eprice;
}
public void setM_Eprice(Engine m_Eprice) {
this.m_Eprice = m_Eprice;
}
public Transmission getM_Tprice() {
return m_Tprice;
}
public void setM_Tprice(Transmission m_Tprice) {
this.m_Tprice = m_Tprice;
}
When i try to call the constructor for this app, everything works fine with no errors in my code, however when i ask to output anything nothing is output at all meaning i cannot properly construct my car using the boundaries within the constructor which are new Car(3000, 500, 1000, 2000) making the app not work correctly although no errors are there to point me in the correct direction.