0

I am trying to use if-else method but what variable should i set to start

I want to be able to put car on P mode, D mode, N mode, R mode * If i am on P mode and parking type is parallel then i can park between two cars * If i am on D mode I can put drive type to Snow type, Sport Type or Regular type * If i am on N mode i can put car in car wash station * If i am on R mode I can only reverse the car and car will activate back camera * If mode is incorrect then print me invalid mode type, please check your car mode*/

11th Dec 2018, 1:49 AM
Mamun Rahman
Mamun Rahman - avatar
1 Answer
+ 1
boolean isMycarOnPmode = true; boolean canParkInParallelMode = true; char parkingMode = 'P'; String parkingType = "Parallel"; if (isMycarOnPmode && canParkInParallelMode) {     if (parkingType.equals("Parallel")) {         System.out.println("I can park in between 2 cars");
11th Dec 2018, 2:31 AM
Mamun Rahman
Mamun Rahman - avatar