TCS Proctored assessment January 2021 | Java program

Publié le: 12 février 2021
sur la chaîne: One stop java solutions By Snehashis
1,768
18

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


Sur cette page du site, vous pouvez voir la vidéo en ligne TCS Proctored assessment January 2021 | Java program durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur One stop java solutions By Snehashis 12 février 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,768 fois et il a aimé 18 téléspectateurs. Bon visionnage!