• Post Reply Bookmark Topic Watch Topic
  • New Topic

Needs some help to complete my work  RSS feed

 
henry degreat
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
Could you please help me to check out these codes and correct it where necessary?
This is all about a project I'm currently working on but it looks like I'm running out of knowledge on how to complete this project.
I'm trying to develop a bicycle maintenance system that could get inputs from the user and then offers some maintenance advice

I have already defined the classes and done working on the respective constructors,
I tried to create three classes of the Bicycle class such as, the MountainBike, SportBike, and ChildrenBike.
such as shown below.
These are the constructors

public class Bicycle{
private static int gear;
private static int speed;
private static int numberOfTiers;

public Bicycle(int StartGear, int startSpeed, int numberOfTiers){

gear = startGear;
speed = startSpeed;
numberOfTiers = startNumberOfTiers;
/*The bicycle superclass has three subclasses,
namely; 1)the mountainBike
2)the sportBike
3)the childrenBike */
}
1. //the mountainBike subclass has three fields/attributes

public int seatHeight;
public static String superBreak;
public boolean hasBigTires;
//one constructor
Bicycle mountainBike(int seatHeight, boolean hasBigTeirs, int StartGear, int startSpeed, int numberOfTiers){
}
2. //sportBike has subclass has one field/attribute
public String shortHandle;
// the constructor
Bicycle sportBike(String shortHandle, int StartGear, int startSpeed, int numberOfTiers){
}
3. //the childrenBilke subclass has one field/attribute
public String smallTiresSize;
//the constructor
Bicycle ChildrenBike(String smallTiers, int StartGear, int startSpeed, int numberOfTiers){
}
}



these is the medoths for the mountainBike

//sportBike method

public class sportBike extends Bicycl{
public int handleLength;

public sportBike(int handle){
handleLength = handle;

}

public void setHandleLength(int newHandleLength){
handleLength = newHandleLength;
if (handleLength <= 4) // that is, the length = 4meters

}

}

the method for the sportBike
//sportBike method

public class sportBike extends Bicycl{
public int handleLength;

public sportBike(int handle){
handleLength = handle;

}

public void setHandleLength(int newHandleLength){
handleLength = newHandleLength;
if (handleLength <= 4) // that is, the length = 4meters

}

}
and finally the method for the ChildrenBike

//childrenBike Methods


public class ChildrenBike {

public String tireSize;
public double area;

public ChildrenBike(String smallSizeTires, double r) {
tireSize = smallSizeTires;
area = r;
}
public void setTireSize(String newTireSize){
tireSize = newTireSize;
}
public void setArea(double rValue){
area = 2*3.14159*rValue;
}
}
The System will get some input from the user such as
1)The area of the tire
2) The seat Height of the bicycle
3) The length of the handle
4) Is the tire Big Size? true, or false?
5) How old is the bicycle
6) How often is the bicycle been used per week?
7) Who is the manufacturer?

The it would offer some advice such as
If old than 6months
If usage is 7*7 //that is 7times a week
1) Service it every week
2. Change spindles every two weeks
3. Change brake pads once every month
4. Change tires once every 6months
5. Service the gear whenever necessary

Guys, please kindly help me check it out and work on the remainging codings.

Thanks all in advance

henry






 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a specific issue that you need a hint at solving? If so, please state the issue, and what do you think that it should be, and we'll give you a nudge in the right direction.

Otherwise, please read this... http://faq.javaranch.com/java/NotACodeMill

Henry
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
henry degreat,

Please read your private messages regarding an important announcement.

Thank you,

Rob
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!