You are on page 1of 29

package Vehicle_Details;

import java.util.Scanner;

public class Driver1 {


static int n;
static
{
System.out.println("********WELCOME TO DESHMUKH MOTORS!!********");
System.out.println("(AUTHORIZED DEALERS OF ALL VEHICLE BRANDS)");
System.out.println("Address:-11/3,Senapati Bapat Marg, Mumbai
400034.");
System.out.println("Contact-8692956239");
System.out.println("");
System.out.println("");
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean a = false;
do {
System.out.println("Please choose from the following Options
Which type of Vehicle you want to Buy:");
System.out.println("1.Two Wheelers");
System.out.println("2.Three Wheelers");
System.out.println("3.Four Wheelers");
System.out.println("4.Heavy Duty Vehicles");
int x=1;
do {
try {
n = sc.nextInt();
x=2;
}catch(Exception au)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("********WELCOME TO DESHMUKH
MOTORS!!********");
System.out.println("(AUTHORIZED DEALERS OF ALL
VEHICLE BRANDS)");
System.out.println("");
System.out.println("Please choose from the following
Options Which type of Vehicle you want to Buy:");
System.out.println("1.Two Wheelers");
System.out.println("2.Three Wheelers");
System.out.println("3.Four Wheelers");
System.out.println("4.Heavy Duty Vehicles");
sc.nextLine();
}
}while(x==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting Option:" +
n + ".Two Wheeler");
System.out.println("Please choose from the following Fuel
Options:");
System.out.println("1.Electric Vehicle");
System.out.println("2.Petrol");
int y=1;
do {
try {
n = sc.nextInt();
y=2;
}catch(Exception ae)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Electric Vehicle");
System.out.println("2.Petrol");
sc.nextLine();
}
}while(y==1);

switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n + ".Electric Vehicle");
System.out.println("Please choose from the following
Company Options:");
System.out.println("1.Ola");
System.out.println("2.TVS iQube");
System.out.println("3.Ather");
int c=1;
do {
try {
n = sc.nextInt();
c=2;
}catch(Exception ab)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Ola");
System.out.println("2.TVS iQube");
System.out.println("3.Ather");
sc.nextLine();
}
}while(c==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====OLA
INFORMATION=====");

System.out.println("-------------------------");
TwoWheeler tw = new ElectricVehicle("OLA",
"RS.100000/-", "BLACK", "WHITE", "BLUE",
"Ola S1 Pro", "120km per Full
Charge", "Medium", "2.90 kWh");
tw.details();
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====TVSiQube INFO=====");
System.out.println("-----------------------");
TwoWheeler tw1 = new ElectricVehicle("TVS
iQUBE", "RS.120000/-", "BLACK", "WHITE", "BLUE",
"IQube I1", "130km per Full
Charge", "Good", "3 kWh");
tw1.details();
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====ATHER INFO=====");
System.out.println("--------------------");
TwoWheeler tw2 = new ElectricVehicle("Ather",
"RS.130000/-", "BLACK", "WHITE", "BLUE",
"Ather 250", "100km per Full
Chrage", "Excellent", "2.7 kWh");
tw2.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n + ".Petrol");
System.out.println("Please choose from the following
Options:");
System.out.println("1.Geared");
System.out.println("2.Non Geared");
int z=1;
do{
try{
n = sc.nextInt();
z=2;
}catch(Exception d)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Geared");
System.out.println("2.Non Geared");
sc.nextLine();
}
}while(z==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n + ".Geared");
System.out.println("Please choose from the
following Company Options:");
System.out.println("1.Royal Enfield");
System.out.println("2.KTM");
System.out.println("3.Yamaha");
int b=1;
do{
try{
n = sc.nextInt();
b=2;
}catch(Exception ac)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Royal
Enfield");
System.out.println("2.KTM");
System.out.println("3.Yamaha");
sc.nextLine();
}
}while(b==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n + ".Royal Enfield");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.Classic");
System.out.println("2.Meteor");
System.out.println("3.Himalayan");
int d=1;
do {
try {
n = sc.nextInt();
d=2;
}catch(Exception ad)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Classic");

System.out.println("2.Meteor");

System.out.println("3.Himalayan");
sc.nextLine();
}
}while(d==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====ROYAL
ENFIELD INFORMATION=====");

System.out.println("-----------------------------------");
Petrol p1 = new Gear("ROYAL
ENFIELD", "RS.250000/-", "STELLAR BLACK", "BATTLE GREEN",
"SUPERNOVA BLUE",
"CLASSIC 350", "30 kmpl", "Excellent", "15 Litres", "BS-VI",
5, "150 kmph", "TOURING
BIKE", "350cc");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====ROYAL
ENFIELD INFORMATION=====");

System.out.println("-----------------------------------");
Petrol p2 = new Gear("ROYAL
ENFIELD", "RS.350000/-", "STELLAR BLACK", "FIREBALL YELLOW",
"FIREBALL RED",
"METEOR", "25 kmpl", "Excellent", "15 Litres", "BS-VI", 5,
"140 kmph", "CRUISER
BIKE", "500cc");
p2.details();
break;
case 3:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====ROYAL
ENFIELD INFORMATION=====");

System.out.println("-----------------------------------");
Petrol p3 = new Gear("ROYAL
ENFIELD", "RS.300000/-", "GRANITE BLACK", "SNOW WHITE",
"LAKE BLUE",
"HIMALAYAN", "30 kmpl", "Excellent", "15 Litres", "BS-VI", 5,
"150 kmph", "TOURING
BIKE", "400cc");
p3.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n + ".KTM");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.Duke");
System.out.println("2.RC");
System.out.println("3.Adventure");
int e=1;
do {
try {
n = sc.nextInt();
e=2;
}catch(Exception af)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Duke");
System.out.println("2.RC");

System.out.println("3.Adventure");
sc.nextLine();
}
}while(e==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====KTM
INFORMATION=====");

System.out.println("-------------------------");
Petrol p1 = new Gear("KTM",
"RS.350000/-", "BLACK", "WHITE", "ORANGE", "DUKE 390",
"25 kmpl", "Excellent",
"10 Litres", "BS-VI", 6, "200 kmph", "RACING BIKE",
"400cc");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====KTM
INFORMATION=====");

System.out.println("-------------------------");
Petrol p2 = new Gear("KTM",
"RS.270000/-", "BLACK", "WHITE", "ORANGE", "RC 200",
"35 kmpl", "Excellent",
"10 Litres", "BS-VI", 6, "150 kmph", "RACING BIKE",
"200cc");
p2.details();
break;
case 3:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====KTM
INFORMATION=====");

System.out.println("-------------------------");
Petrol p3 = new Gear("KTM",
"RS.500000/-", "BLACK", "WHITE", "ORANGE", "ADVENTURE 390",
"25 kmpl", "Excellent",
"15 Litres", "BS-VI", 6, "200 kmph", "RACING BIKE",
"400cc");
p3.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n + ".Yamaha");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.R15");
System.out.println("2.VMAX");
System.out.println("3.Saluto");
int f=1;
do {
try {
n = sc.nextInt();
f=2;
}catch(Exception ag)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.R15");
System.out.println("2.VMAX");

System.out.println("3.Saluto");
sc.nextLine();
}
}while(f==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====YAMAHA
INFORMATION=====");

System.out.println("----------------------------");
Petrol p1 = new Gear("YAMAHA",
"RS.170000/-", "DARK KNIGHT", "RACING BLUE",
"METALLIC GREY", "R15-
V3", "50 kmpl", "Excellent", "10 Litres", "BS-VI", 5,
"150 kmph", "SPORT
BIKE", "150cc");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====YAMAHA
INFORMATION=====");

System.out.println("----------------------------");
Petrol p2 = new Gear("YAMAHA",
"RS.2700000/-", "BLACK", "YELLOW", "ORANGE", "VMAX",
"11 kmpl", "Excellent",
"15 Litres", "BS-VI", 5, "240 kmph",
"POWER CRUISER BIKE",
"1200cc");
p2.details();
break;
case 3:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====YAMAHA
INFORMATION=====");

System.out.println("----------------------------");
Petrol p3 = new Gear("YAMAHA",
"RS.70000/-", "BRAVE BLACK", "MATT GREEN", "ARMADA BLUE",
"SALUTO", "80 kmpl",
"Good", "15 Litres", "BS-VI", 6, "90 kmph", "BASIC BIKE",
"125cc");
p3.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
default:
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
}
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n + ".Non Geared");
System.out.println("Please choose from the
following Company Options:");
System.out.println("1.Honda");
System.out.println("2.TVS");
System.out.println("3.Suzuki");
int g=1;
do {
try {
n = sc.nextInt();
g=2;
}catch(Exception ah)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Honda");
System.out.println("2.TVS");
System.out.println("3.Suzuki");
sc.nextLine();
}
}while(g==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n + ".Honda");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.Activa");
System.out.println("2.Grazia");
int h=1;
do {
try {
n = sc.nextInt();
h=2;
}catch(Exception ai)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Activa");

System.out.println("2.Grazia");
sc.nextLine();
}
}while(h==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====HONDA
INFORMATION=====");

System.out.println("---------------------------");
Petrol p1 = new NonGear("HONDA",
"RS.80000/-", "PEARL IGNEOUS BLACK",
"PEARL PRECIOUS WHITE",
"DECENT BLUE", "ACTIVA 6G", "50 kmpl", "Good",
"5 Litres", "BS-VI",
"125cc", "18 Litres");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====HONDA
INFORMATION=====");

System.out.println("---------------------------");
Petrol p2 = new NonGear("HONDA",
"RS.85000/-", "PEARL SPARTAN RED", "PEARL NIGHT BLACK",
"PEARL SIREN BLUE",
"GRAZIA", "55 kmpl", "Good", "5 Litres", "BS-VI", "125cc",
"15 Litres");
p2.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n + ".TVS");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.Ntorq");
System.out.println("2.Scooty Pep");
int i=1;
do {
try {
n = sc.nextInt();
i=2;
}catch(Exception aj)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Ntorq");
System.out.println("2.Scooty
Pep");
sc.nextLine();
}
}while(i==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====TVS
INFORMATION=====");

System.out.println("-------------------------");
Petrol p1 = new NonGear("TVS",
"RS.85000/-", "STEALTH BLACK", "MATTE RED",
"COMBAT BLUE", "NTORQUE
125", "45 kmpl", "Good", "6 Litres", "BS-VI", "125cc",
"15 Litres");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====TVS
INFORMATION=====");

System.out.println("-------------------------");
Petrol p2 = new NonGear("TVS",
"RS.65000/-", "PRINCESS PINK", "FROSTED BLACK",
"AQUA MATTE", "SCOOTY
PEP", "55 kmpl", "Good", "4.5 Litres", "BS-VI", "90cc",
"19 Litres");
p2.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n + ".Suzuki");
System.out.println("Please choose from
the following Model Options:");
System.out.println("1.Access");
System.out.println("2.Avenis");
System.out.println("3.Burgman");
int j=1;
do {
try {
n = sc.nextInt();
j=2;
}catch(Exception ak)
{
System.out.println("PLEASE ENTER
THE VALID OPTION!!");
System.out.println("1.Access");

System.out.println("2.Avenis");

System.out.println("3.Burgman");
sc.nextLine();
}
}while(j==1);
switch (n) {
case 1:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====SUZUKI
INFORMATION=====");

System.out.println("----------------------------");
Petrol p1 = new NonGear("SUZUKI",
"RS.75000/-", "GLOSSY GREY", "PEARL MIRAGE WHITE",
"MATTEE BLACK", "ACCESS
125", "60 kmpl", "Good", "5.5 Litres", "BS-VI", "125cc",
"20 Litres");
p1.details();
break;
case 2:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====SUZUKI
INFORMATION=====");

System.out.println("----------------------------");
Petrol p2 = new NonGear("SUZUKI",
"RS.110000/-", "TRITON BLUE", "SPARKLE BLACK",
"LUSH GREEN", "AVENIS
125", "55 kmpl", "Good", "4.5 Litres", "BS-VI", "125cc",
"19 Litres");
p2.details();
break;
case 3:
System.out.println("Thank you for
for selecting Option:" + n);
System.out.println("=====SUZUKI
INFORMATION=====");

System.out.println("----------------------------");
Petrol p3 = new NonGear("SUZUKI",
"RS.120000/-", "MATTE BLUE", "PEARL MIRAGE WHITE",
"GLOSSY GREY",
"BURGMAN", "50 kmpl", "Good", "5.5 Litres", "BS-VI", "125cc",
"22 Litres");
p3.details();
break;
default:System.out.println("PLEASE ENTER
THE VALID OPTION!!");
break;
}
break;
default:
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
}
break;
default:
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
}
break;

default:
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
}
break;
case 2:
System.out.println("Thank you for for selecting Option:" +
n + ".Three Wheeler");
System.out.println("Please choose from the following
Company Model Options:");
System.out.println("1.Bajaj Auto");
System.out.println("2.Piaggio");
System.out.println("3.TVS Auto");
int k=1;
do {
try {
n = sc.nextInt();
k=2;
}catch(Exception al)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Bajaj Auto");
System.out.println("2.Piaggio");
System.out.println("3.TVS Auto");
sc.nextLine();
}
}while(k==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====BAJAJ AUTO
INFORMATION=====");
System.out.println("----------------------------");
Vehicle v1 = new ThreeWheeler("BAJAJ AUTO",
"RS.130000/-", "BLACK+YELLOW", "GREEN+YELLOW", "",
"RE COMPACT 4S", "30 kmpl", "CNG",
"198cc");
v1.details();
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====PAGGIO INFORMATION=====");
System.out.println("----------------------------");
Vehicle v2 = new ThreeWheeler("PAGGIO",
"RS.200000/-", "BLACK", "YELLOW", "", "APE AUTO DX",
"25 kmpl", "Diesel", "230 cc");
v2.details();
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====TVS AUTO INFORMATION=====");
System.out.println("----------------------------");
Vehicle v3 = new ThreeWheeler("TVS AUTO",
"RS.180000/-", "BLACK", "GREEN", "YELLOW", "TVS KING 4S",
"27 kmpl", "LPG", "145 cc");
v3.details();
break;
default:System.out.println("PLEASE ENTER THE VALID
OPTION!!");
break;
}
break;
case 3:
System.out.println("Thank you for for selecting Option:" +
n + ".Four Wheeler");
System.out.println("Please choose from the following Fuel
Options:");
System.out.println("1.Electric Vehicle");
System.out.println("2.Petrol");
System.out.println("3.Diesel");
int l=1;
do {
try {
n = sc.nextInt();
l=2;
}catch(Exception am)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Electric Vehicle");
System.out.println("2.Petrol");
System.out.println("3.Diesel");
sc.nextLine();
}
}while(l==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n + ".Electric Vehicle");
System.out.println("Please choose from the following
Company models Options:");
System.out.println("1.Tata Nexon");
System.out.println("2.MG ZS");
System.out.println("3.Hyundai Kona");
int m=1;
do {
try {
n = sc.nextInt();
m=2;
}catch(Exception an)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Tata Nexon");
System.out.println("2.MG ZS");
System.out.println("3.Hyundai Kona");
sc.nextLine();
}
}while(m==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f1 = new ElectricVehicle1("TATA",
"RS.1570000/-", "MIDNIGHT BLACK",
"SIGNATURE TEAL BLUE", "INTEANSI
TEAL", "EV XZ+", "312km per Full Charge", "95kW",
"Five", "SUV", "YES", "350 Litres",
"30.2KWh 320V Lithium Polymer", "120 kmph");
f1.details();
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====MORRIS GARAGES
INFORMATION=====");

System.out.println("------------------------------------");
FourWheeler f2 = new ElectricVehicle1("MORRIS
GARAGES", "RS.2580000/-", "SABLE BLACK",
"CURRANT RED", "ASHEN SILVER", "MG
ZS EV", "461km per Full Charge", "127kW", "Five",
"SUV", "YES", "470 Litres",
"50.3KWh 384V Lithium-Ion", "140 kmph");
f2.details();
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====HYUNDAI
INFORMATION=====");

System.out.println("----------------------------");
FourWheeler f3 = new
ElectricVehicle1("HYUNDAI", "RS.2400000/-", "ULTRA BLACK", "SURF BLUE",
"CHALK WHITE", "SE ULTIMATE",
"452km per Full Charge", "100kW", "Five", "SUV", "YES",
"332 Litres", "67.5KWh 327V Lithium
Polymer", "167 kmph");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE VALID
OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n + ".Petrol");
System.out.println("Please choose from the following
Company Options:");
System.out.println("1.Tata");
System.out.println("2.Mahindra");
System.out.println("3.Hyundai");
int o=1;
do {
try {
n = sc.nextInt();
o=2;
}catch(Exception ao)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Tata");
System.out.println("2.Mahindra");
System.out.println("3.Hyundai");
sc.nextLine();
}
}while(o==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n + ".Tata");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.Tiago");
System.out.println("2.Harrier");
System.out.println("3.Altroz");
int p=1;
do {
try {
n = sc.nextInt();
p=2;
}catch(Exception ap)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Tiago");
System.out.println("2.Harrier");
System.out.println("3.Altroz");
sc.nextLine();
}
}while(p==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f1 = new Petrol1("TATA
TIAGO", "RS.550000/-", "MIDNIGHT PLUS", "FORESTA GREEN",
"OPAL WHITE", "XZA PLUS",
"20kmpl", "BS-VI,", "80 bhp", "Five", "HATCHBACK",
"242 Litres", "POWER
STEARING", "50 Litres", "165 kmph", "AUTOMATIC");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f2 = new Petrol1("TATA
HARRIER", "RS.1500000/-", "TROPICAL MIST",
"OBERON BLACK", "ORCUS
WHITE", "XZ PLUS", "15kmpl", "BS-VI,", "168 bhp", "Five",
"SUV", "435 Litres", "POWER
STEARING", "50 Litres", "180 kmph", "AUTOMATIC");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f3 = new Petrol1("TATA
ALTROZ", "RS.750000/-", "COSMO DARK", "OPERA BLUE",
"ARCADE GREY", "XE PLUS",
"20kmpl", "BS-VI,", "107 bhp", "Five", "HATCHBACK",
"345 Litres", "POWER
STEARING", "37 Litres", "160 kmph", "AUTOMATIC");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n + ".Mahindra");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.Thar");
System.out.println("2.XUV");
System.out.println("3.Marazzo");
int q=1;
do {
try {
n = sc.nextInt();
q=2;
}catch(Exception aq)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Thar");
System.out.println("2.XUV");
System.out.println("3.Marazzo");
sc.nextLine();
}
}while(q==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f1 = new Petrol1("MAHINDRA
THAR", "RS.1500000/-", "NAPOLI BLACK", "RED RAGE",
"AQUAMARINE", "THAR LX",
"15kmpl", "BS-VI,", "134 bhp", "Four", "SUV", "600 Litres",
"POWER STEARING", "57
Litres", "155 kmph", "AUTOMATIC");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f2 = new Petrol1("MAHINDRA
XUV", "RS.1600000/-", "CRIMSON RED", "VOLCANO BLACK",
"PEARL WHITE", "XUV 500",
"16kmpl", "BS-VI,", "153 bhp", "SEVEN", "SUV",
"435 Litres", "POWER
STEARING", "93 Litres", "185 kmph", "AUTOMATIC");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f3 = new Petrol1("MAHINDRA
MARAZZO", "RS.1550000/-", "ICEBERG WHITE",
"SIMERING SILVER", "OCEANIC
BLACK", "M6+", "17kmpl", "BS-VI,", "120 bhp", "Eight",
"MUV", "190 Litres", "POWER
STEARING", "45 Litres", "145 kmph", "AUTOMATIC");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n + ".Hyundai");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.Venue");
System.out.println("2.Sonata");
System.out.println("3.Elantra");
int r=1;
do {
try {
n = sc.nextInt();
r=2;
}catch(Exception ar)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Venue");
System.out.println("2.Sonata");
System.out.println("3.Elantra");
sc.nextLine();
}
}while(r==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====HYUNDAI
INFORMATION=====");

System.out.println("-----------------------------");
FourWheeler f1 = new Petrol1("HYUNDAI
VENUE", "RS.800000/-", "FIERY RED", "POLAR WHITE",
"DENIM BLUE", "1.2 KAPPA MT
S+", "23kmpl", "BS-VI,", "107 bhp", "Five", "SUV",
"350 Litres", "POWER
STEARING", "45 Litres", "160 kmph", "AUTOMATIC");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====HYUNDAI
INFORMATION=====");

System.out.println("-----------------------------");
FourWheeler f2 = new Petrol1("HYUNDAI
SONATA", "RS.2000000/-", "CALYPSO RED",
"PHANTOM BLACK", "QUARTZ
WHITE", "SONATA SEL", "12kmpl", "BS-VI,", "198 bhp",
"Five", "SEDAN", "462
Litres", "POWER STEARING", "70 Litres", "195 kmph",
"6-SPEED MANUAL");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====HYUNDAI
INFORMATION=====");

System.out.println("-----------------------------");
FourWheeler f3 = new Petrol1("HYUNDAI
ELANTRA", "RS.1550000/-", "FIERY RED", "POLAR WHITE",
"DENIM BLUE", "CN-7",
"14kmpl", "BS-VI,", "151 bhp", "Five", "COMPACT CAR",
"420 Litres", "POWER
STEARING", "56 Litres", "140 kmph", "6-SPEED MANUAL");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
default:
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
}
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n + ".Diesel");
System.out.println("Please choose from the following
Company Options:");
System.out.println("1.Ford");
System.out.println("2.Mahindra and Mahindra");
System.out.println("3.Tata");
int s1=1;
do {
try {
n = sc.nextInt();
s1=2;
}catch(Exception as)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Ford");
System.out.println("2.Mahindra and
Mahindra");
System.out.println("3.Tata");
sc.nextLine();
}
}while(s1==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n + ".Ford");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.Figo");
System.out.println("2.Endeavour");
System.out.println("3.EcoSport");
int t=1;
do {
try {
n = sc.nextInt();
t=2;
}catch(Exception at)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Figo");
System.out.println("2.Endeavour");
System.out.println("3.EcoSport");
sc.nextLine();
}
}while(t==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====FORD
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f1 = new Petrol1("FORD FIGO",
"RS.850000/-", "RUBY RED", "MOONDUST SILVER",
"DIAMOND WHITE", "FIGO
TITANIUM BLU", "25.5kmpl", "BS-VI,", "80 bhp", "Five",
"SUBCOMPACT HATCHBACK", "257
Litres", "POWER STEARING", "40 Litres", "170 kmph",
"MANUAL");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====FORD
INFORMATION=====");
System.out.println("--------------------------");
FourWheeler f2 = new Petrol1("FORD
ENDEAVOUR", "RS.3200000/-", "DIAMOND WHITE",
"ABSOLUTE BLACK", "DIFUSSED
SILVER", "SPORT 4X4 AT", "13.9kmpl", "BS-VI,",
"196 bhp", "SEVEN", "SUV",
"450 Litres", "POWER STEARING", "80 Litres", "180 kmph",
"AUTOMATIC");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====FORD
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f3 = new Petrol1("FORD
ECOSPORT", "RS.900000/-", "DIAMOND WHITE",
"ABSOLUTE BLACK", "DIFUSSED
SILVER", "ECOSPORT S MT", "21.7kmpl", "BS-VI,",
"120 bhp", "Five", "SUV",
"355 Litres", "POWER STEARING", "52 Litres", "182 kmph",
"MANUAL");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n + ".Mahindra and Mahindra");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.TUV");
System.out.println("2.XUV");
System.out.println("3.Quanto");
int u=1;
do {
try {
n = sc.nextInt();
u=2;
}catch(Exception au)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.TUV");
System.out.println("2.XUV");
System.out.println("3.Quanto");
sc.nextLine();
}
}while(u==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f1 = new Petrol1("MAHINDRA
TUV", "RS.1050000/-", "HIGHWAY RED", "BOLD BLACK",
"MYSTIC COPPER", "TUV 300 T4
PLUS", "18.4kmpl", "BS-VI,", "93 bhp", "Feven", "SUV",
"384 Litres", "POWER
STEARING", "50 Litres", "160 kmph", "AUTOMATIC");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f2 = new Petrol1("MAHINDRA
XUV", "RS.1500000/-", "CRIMSON RED", "VOLCANO BLACK",
"PEARL WHITE", "XUV 500",
"15.1kmpl", "BS-VI,", "152 bhp", "SEVEN", "SUV",
"435 Litres", "POWER
STEARING", "70 Litres", "180 kmph", "MANUAL");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====MAHINDRA
INFORMATION=====");

System.out.println("------------------------------");
FourWheeler f3 = new Petrol1("MAHINDRA
QUANTO", "RS.750000/-", "DIAMOND WHITE",
"FIERY BLACK", "MIST SILVER",
"C8", "17kmpl", "BS-VI,", "100 bhp", "Seven", "SUV",
"300 Litres", "POWER
STEARING", "55 Litres", "160 kmph", "MANUAL");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n + ".Tata");
System.out.println("Please choose from the
following Model Options:");
System.out.println("1.Altroz");
System.out.println("2.Zest");
System.out.println("3.Nexon");
int v=1;
do {
try {
n = sc.nextInt();
v=2;
}catch(Exception av)
{
System.out.println("PLEASE ENTER THE
VALID OPTION!!");
System.out.println("1.Altroz");
System.out.println("2.Zest");
System.out.println("3.Nexon");
sc.nextLine();
}
}while(v==1);
switch (n) {
case 1:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f1 = new Petrol1("TATA
ALTROZ", "RS.900000/-", "HORBOUR BLUE", "AVENUE WHITE",
"MIDTOWN GREY", "XT",
"25kmpl", "BS-VI,", "88 bhp", "Five", "HATCHBACK",
"345 Litres", "POWER
STEARING", "37 Litres", "170 kmph", "MANUAL");
f1.details();
break;
case 2:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f2 = new Petrol1("TATA ZEST",
"RS.7500000/-", "PISTINE WHITE", "BUZZ BLUE",
"SKY GREY", "XE 75 PS",
"17.5kmpl", "BS-VI,", "89 bhp", "Five", "COMPACT SEDAN",
"390 Litres", "POWER
STEARING", "44 Litres", "155 kmph", "AUTOMATIC");
f2.details();
break;
case 3:
System.out.println("Thank you for for
selecting Option:" + n);
System.out.println("=====TATA
INFORMATION=====");

System.out.println("--------------------------");
FourWheeler f3 = new Petrol1("TATA
NEXON", "RS.1300000/-", "ATLAS BLACK", "ROYALE BLUE",
"FOLIAGE GREEN", "XZA PLUS",
"22kmpl", "BS-VI,", "108 bhp", "Five", "SUV",
"350 Litres", "POWER
STEARING", "44 Litres", "180 kmph", "AUTOMATIC");
f3.details();
break;
default:System.out.println("PLEASE ENTER THE
VALID OPTION!!");
break;
}
break;
default:
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
}
break;
default:
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
}
break;

case 4:
System.out.println("");
System.out.println("Thank you for for selecting Option:" +
n + ".Heavy Duty Vehicles");
System.out.println("Please choose from the following
Company model Options:");
System.out.println("1.Eicher Truck");
System.out.println("2.Ashok Leyland Truck");
System.out.println("3.Tata Truck");
int w=1;
do {
try {
n = sc.nextInt();
w=2;
}catch(Exception ae)
{
System.out.println("PLEASE ENTER THE VALID
OPTION!!");
System.out.println("1.Eicher Truck");
System.out.println("2.Ashok Leyland Truck");
System.out.println("3.Tata Truck");
sc.nextLine();
}
}while(w==1);
switch (n) {
case 1:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====EICHER TRUCK
INFORMATION=====");

System.out.println("----------------------------------");
Vehicle v1 = new HeavyDuty("EICHER TRUCK",
"RS.1200000/-", "ORANGE", "RED", "", "PRO 1110 BS-IV",
"7kmpl", "8000kg", "SIX WHEELS", "17Feet
Long X 7Feet Wide", "DIESEL", "190 Litres",
"MANUAL STEERING", "AIR BRAKES,NO ABS",
"SEMI-ELLIPTICAL LAMINATED LEAVES");
v1.details();
break;
case 2:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====ASHOK LEYLAND TRUCK
INFORMATION=====");
System.out.println("----------------------------------------");
Vehicle v2 = new HeavyDuty("ASHOK LEYLAND TRUCK",
"RS.1400000/-", "WHITE", "", "", "AS PARTNER 6",
"8kmpl", "4500kg", "SIX WHEELS", "17Feet
Long X 7Feet Wide", "DIESEL", "90 Litres",
"POWER STEERING", "AIR BRAKES WITH ABS",
"PARABOLIC OVERSLUNG SUSPENSION WITH
DOUBLE ACTING SHOCK ABSORBERS");
v2.details();
break;
case 3:
System.out.println("Thank you for for selecting
Option:" + n);
System.out.println("=====TATA TRUCK
INFORMATION=====");

System.out.println("--------------------------------");
Vehicle v3 = new HeavyDuty("TATA TRUCK",
"RS.2300000/-", "ORANGE", "", "", "TATA1512 LPT", "6kmpl",
"9500kg", "SIX WHEELS", "22Feet Long X
7Feet Wide", "DIESEL", "160 Litres",
"POWER STEERING", "AIR BRAKES WITH ABS",
"PARABOLIC SEMI ELLIPTICAL LEAF
SPRINGWITH HYDRAULIC DOUBLE ACTING SHOCK ABSORBERS");
v3.details();
break;
default:System.out.println("PLEASE ENTER THE VALID
OPTION!!");
break;
}
break;
default:
System.out.println("PLEASE ENTER THE VALID OPTION!!");
}
System.out.println("Do you want to Continue? True/False");
sc.nextLine();
int s = 1;
do{
try {
a = sc.nextBoolean();
s=2;
}catch(Exception ae)
{
System.out.println("Please Enter True/False");
sc.nextLine();
}
}while(s==1);

} while (a == true);
}
}

class Vehicle {
String name;
String price;
String colour1;
String colour2;
String colour3;
String model;
String mileage;

public Vehicle(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage) {
this.name = name;
this.price = price;
this.colour1 = colour1;
this.colour2 = colour2;
this.colour3 = colour3;
this.model = model;
this.mileage = mileage;
}

public void details() {


System.out.println("BRAND NAME: " + name);
System.out.println("COLOUR OPTIONS: " + colour1 + "," + colour2 + "," +
colour3 + ".");
System.out.println("MODEL NO.: " + model);
System.out.println("TOTAL AMOUNT: " + price);
System.out.println("MILEAGE: " + mileage);
}
}

class TwoWheeler extends Vehicle {


String suspension;

public TwoWheeler(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String suspension) {
super(name, price, colour1, colour2, colour3, model, mileage);
this.suspension = suspension;
}

public void details() {


super.details();
System.out.println("SUSPENSION LEVEL: " + suspension);
}

class ElectricVehicle extends TwoWheeler {


String battery;

public ElectricVehicle(String name, String price, String colour1, String


colour2, String colour3, String model,
String mileage, String suspension, String battery) {
super(name, price, colour1, colour2, colour3, model, mileage,
suspension);
this.battery = battery;
}

public void details() {


super.details();
System.out.println("BATTERY INFO: " + battery);
}

}
class Petrol extends TwoWheeler {
String fuelcapacity;
String engine;

public Petrol(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String suspension, String fuelcapacity, String
engine) {
super(name, price, colour1, colour2, colour3, model, mileage,
suspension);
this.fuelcapacity = fuelcapacity;
this.engine = engine;
}

public void details() {


super.details();
System.out.println("FUEL CAPACITY: " + fuelcapacity);
System.out.println("ENGINE DETAILS: " + engine);
}
}

class Gear extends Petrol {


int gears;
String topspeed;
String biketype;
String cc;

public Gear(String name, String price, String colour1, String colour2, String
colour3, String model, String mileage,
String suspension, String fuelcapacity, String engine, int gears,
String topspeed, String biketype,
String cc) {
super(name, price, colour1, colour2, colour3, model, mileage,
suspension, fuelcapacity, engine);
this.gears = gears;
this.topspeed = topspeed;
this.biketype = biketype;
this.cc = cc;
}

public void details() {


super.details();
System.out.println("CC: " + cc);
System.out.println("Type of Bike: " + biketype);
System.out.println("NUMBER OF GEARS: " + gears);
System.out.println("TOP SPEED: " + topspeed);
}
}

class NonGear extends Petrol {


String bootspace;
String cc;

public NonGear(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String suspension, String fuelcapacity, String
engine, String cc, String bootspace) {
super(name, price, colour1, colour2, colour3, model, mileage,
suspension, fuelcapacity, engine);
this.bootspace = bootspace;
this.cc = cc;
}

public void details() {


super.details();
System.out.println("CC: " + cc);
System.out.println("BOOT SPACE: " + bootspace);
}
}

class ThreeWheeler extends Vehicle {


String fuel;
String cc;

public ThreeWheeler(String name, String price, String colour1, String


colour2, String colour3, String model,
String mileage, String fuel, String cc) {
super(name, price, colour1, colour2, colour3, model, mileage);
this.fuel = fuel;
this.cc = cc;
}

public void details() {


super.details();
System.out.println("OPERATING FUEL: " + fuel);
System.out.println("CC: " + cc);
}
}

class FourWheeler extends Vehicle {


String power;
String seating;
String type;
String stearing;
String bootspace;
String topspeed;

public FourWheeler(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String power, String seating, String type, String
stearing, String bootspace,
String topspeed) {
super(name, price, colour1, colour2, colour3, model, mileage);
this.power = power;
this.seating = seating;
this.type = type;
this.stearing = stearing;
this.bootspace = bootspace;
this.topspeed = topspeed;

public void details() {


super.details();
System.out.println("ENGINE/MOTOR POWER: " + power);
System.out.println("TOP SPEED: " + topspeed);
System.out.println("SEATING CAPACITY: " + seating);
System.out.println("VEHICLE TYPE: " + type);
System.out.println("BOOT CAPACITY: " + bootspace);
System.out.println("STEARING TYPE: " + stearing);
}
}

class ElectricVehicle1 extends FourWheeler {


String battery;

public ElectricVehicle1(String name, String price, String colour1, String


colour2, String colour3, String model,
String mileage, String power, String seating, String type, String
stearing, String bootspace,
String battery, String topspeed) {
super(name, price, colour1, colour2, colour3, model, mileage, power,
seating, type, stearing, bootspace,
topspeed);
this.battery = battery;
}

public void details() {


super.details();
System.out.println("BATTERY INFO: " + battery);
}
}

class Petrol1 extends FourWheeler {


String fuelcapacity;
String engine;
String transmission;

public Petrol1(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String engine, String power, String seating,
String type, String stearing, String bootspace,
String fuelcapacity, String topspeed, String transmission) {
super(name, price, colour1, colour2, colour3, model, mileage, power,
seating, type, bootspace, stearing,
topspeed);
this.fuelcapacity = fuelcapacity;
this.engine = engine;
this.transmission = transmission;
}

public void details() {


super.details();
System.out.println("ENGINE: " + engine);
System.out.println("FUEL CAPACITY: " + fuelcapacity);
System.out.println("TRANSMISSION TYPE: " + transmission);

}
}

class Diesel extends FourWheeler {


String fuelcapacity;
String engine;
String transmission;

public Diesel(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String engine, String power, String seating,
String type, String stearing, String bootspace,
String fuelcapacity, String topspeed, String transmission) {
super(name, price, colour1, colour2, colour3, model, mileage, power,
seating, type, bootspace, stearing,
topspeed);
this.fuelcapacity = fuelcapacity;
this.engine = engine;
this.transmission = transmission;
}

public void details() {


super.details();
System.out.println("ENGINE: " + engine);
System.out.println("FUEL CAPACITY: " + fuelcapacity);
System.out.println("TRANSMISSION TYPE: " + transmission);
}
}

class HeavyDuty extends Vehicle {


String capacity;
String wheels;
String dimensions;
String fuel;
String fuelcapacity;
String stearing;
String brakes;
String suspension;

public HeavyDuty(String name, String price, String colour1, String colour2,


String colour3, String model,
String mileage, String capacity, String wheels, String
dimensions, String fuel, String fuelcapacity,
String stearing, String brakes, String suspension) {
super(name, price, colour1, colour2, colour3, model, mileage);
this.capacity = capacity;
this.wheels = wheels;
this.dimensions = dimensions;
this.fuel = fuel;
this.fuelcapacity = fuelcapacity;
this.stearing = stearing;
this.brakes = brakes;
this.suspension = suspension;
}

public void details() {


super.details();
System.out.println("LOAD CARRYING CAPACITY: " + capacity);
System.out.println("NUMBER OF WHEELS: " + wheels);
System.out.println("VEHICLE DIMENSIONS: " + dimensions);
System.out.println("OPERATING FUEL: " + fuel);
System.out.println("FUEL TANK CAPACITY: " + fuelcapacity);
System.out.println("STEERING TYPE: " + stearing);
System.out.println("BRAKING SYSTEM: " + brakes);
System.out.println("SUSPENSION TYPE: " + suspension);
}
}

You might also like