-
Have these values, car manufactures year, car price and car name. Then pass a value which can calculate care price multiply car manufactured year.
-
Create a new private and public classes that can get at least 3 cars, model, make and price from the terminal, and then calculate the average prices of the cars and show it in the terminal.
2.1. Use the code in assignment 2 and use if and else statement so, if the average car prices are higher than the 100,000 the output shows the cars are expensive if its between 50,000 to 99,999 the output shows the cars are normal price and if it is less than 49,999 it shows the cars are cheap
2.2. Do the same as 2.1 just instead of if and else statement use ternary operator
-
Create a loop that uses the for loop whtich begins from the number 1 and adds single number each. it continues till it breaks at number 26. Use break at number number 26 and continue in number 14
-
Create a Matrix with 3 rows and 3 columns which contains the car models and prices then fetch the car which values above 50,000 RM and portray it in the terminal
-
Use scanner to get the prices of the 5 different cars from the terminal and if the value of the car is equal or above 70000 RM, put them in the matrix of 22 which shows the value, "VIP", "2024", "pre-order" and if the value is below the 70000 put them in the matrix of 22 which shows the value, "Cheap", "old", "for sale"
-
Use Scanner to get the day number and the result of the switch must be portrayed in the console.
-
Create new file that the scanner get the value for the switch, if the user choose 1 he/she will enter stage that he/she needs to enter a value for 34 matrix, if the user choose 2 he/she will enter the stage that he/she need to enter values for 23 matrix. The result of the user must be shown regardless of the option.
-
Pass the person age and name and hight and weight using scanner, use the encapsulation to have set and get data and use the following formula to calculate bmi: (height-100)/weight
The final result in console must be the following:
The person name is ${genrated_name} and he/she is ${generated_age} years old and his/her bmi is ${calculated_value_of_bmi}
-
Use the same code in assignment 7 this time. For both option 1 and option 2 the user must enter 12 values. If the user choose option 1 he/she will get the proper output but if the user chooses the option 2, he/she will get ArrayIndexOutOfBoundsException error.
-
Make a run-time polymorphism, has 3 extends for the cars. The user is supposed to enter the car name in the terminal and this is going to be output: if the user enters Toyota, the output should be 25,000RM if the user enters BMW, the output should be 85,000RM if the user enters Tesla, the output should be 75,000RM
-
Same as the excercise 10 but this time instead of polymorphism, use the abstract and there should be a business slogan on top of the price for each car
-
Same as the excercise 10 but this time instead of polymorphism, use the interface and there should be this meassage for Tesla:
"Yes Tesla is the best electric car"
there should be this meassage for BMW:
"BMW is one of the coolest car in the world"