• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Needs some help to complete my work

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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






 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
henry degreat,

Please read your private messages regarding an important announcement.

Thank you,

Rob
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic