TCS Proctored assessment January 2021 | Java program
My channel : / @onestopjavasolutionsbysneh1084
Previous Video : • TCS Proctored assessment 11th Decembe...
Next Video :
TCS Proctored Assessment 2021 January
Create a class Appliance with below attributes:
int applianceld
String applianceName
String applianceCategory
double applianceAmount
boolean insurance
Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence except insurance attribute
Public class MyClass is already created with main method. Code inside main method should not be altered else your solution might be scored as zero. Implement two static methods - getApplianceAmount and getCostliestAppliance in MyClass class.
getApplianceAmount method: This method will take three input parameters -array of Appliance objects ,int parameter applianceld,boolean parameter insurance. If the input parameter applianceld matches with the applianceld attribute of the Appliance object and boolean parameter insurance is true then the appliance amount is calculated as below
newApplianceAmount = applianceAmount + (( applianceAmount *20)/100) Update the applianceAmount attribute of the appliance object with the newly calculated value and return it. If condition is not met, then the method should return 0.
getCostliestAppliance method: This method will take two input parameters -array of Appliance objects, string parameter applianceCategory. This method will return costliest appliance object if the applianceCategory matches with the input string parameter. If condition is not met, then the method should return null.
Note : All searches should be case insensitive
These methods should be called from the main method.
Main method mentioned above already has Scanner code to read values, create objects and test above methods. Hence do not modify it.
Consider below sample input and output:
Sample Input:
111
Washing Machine
Electronics
20000
112
Refrigerator
Digital
30000
114
Saucepan
Cookware
2000
113
OTG
Cookware
25000
112
true
Cookware
Sample Output:
Appliance Amount after adding insurance is :36000.0
Appliance Id:113
Appliance Name: OTG
En esta página del sitio puede ver el video en línea TCS Proctored assessment January 2021 | Java program de Duración hora minuto segunda en buena calidad , que subió el usuario One stop java solutions By Snehashis 12 febrero 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,768 veces y le gustó 18 a los espectadores. Disfruta viendo!