Note that there are some explanatory texts on larger screens.

plurals
  1. POmodeling a real world problem into java classes
    primarykey
    data
    text
    <p>How can i model foollwing problem statatement into java classe?</p> <p>I have a class vehincle.</p> <ul> <li>Vehicles can be of type Trucks, Cars, Scooters, motorcycles.</li> <li>Vehicle has a engine.</li> <li>engine shold have following contraints <ul> <li>Petrol Engine and Diesel Engine are types of Engines</li> <li>Truck comes with 4 stroke, 12 cylinder Diesel Engine</li> <li>Car can have either 4 stroke Petrol Engine or 4 stroke Diesel Engine</li> <li>Car can have either 4 Cylinder Engine or 6 Cylinder Engine.</li> <li>Motorcycle can have 4 stroke single Cylinder Petrol Engine or 4 stroke twin-cylinder Petrol engine.</li> <li>Scooters can have Single Cylinder 2 Stroke Petrol Engine or Single Cylinder 4 stroke Petrol Engine.</li> </ul></li> <li>Each engine consists of <ul> <li>Number of cylinders [1/2/4/6/12 only]</li> <li>Number of strokes [2/4 only].</li> <li>‘Engine Number’ is always 6 characters alphanumeric.</li> </ul></li> <li>Diesel engine always comes with 4 strokes but Petrol engine can come with either 2 strokes or 4 strokes.</li> <li>Only Petrol engines have Spark plugs [One per cylinder]. Diesel Engine cannot have Spark plugs.</li> <li>Sparkplug just has sequence number [e.g Car with 6 Cylinder Engine will have Sparkplugs SP1, SP2, SP3, SP4, SP5, SP6]</li> <li>Only Trucks and Cars have Oil Pump. </li> <li>Each Oil pump has <ul> <li>Identification number 6 char alphanumeric</li> <li>Capacity in cubic centimeters(cc) per seconds [value can be between 1-5]</li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload