Find interest valueCreate a class Account with below attributes: int iddouble balancedouble interestRate Class should have getters, setters and constructor with parameters in above sequence of attributes. Create a class Solution with main method. Read one integer and two double values using Scanner object and create object of Account class. These values should be mapped to id, balance and interestRate attributes.Read one more integer value and store it in variable noOfYears. Write a method calculateInterest which will take account object and no of years as input parameters and return the interest amount.Consider below logic to calculate the interest value: For specified no of years, first find out the percentage value those no of years based on specified interestRate. E.g. if no of years is 5 and specified interestRate is 4%, then 4% of 5 is 0.2. This percentage should be added to original interstRate for calculating the final interest value. Hence for above example it will be 4.2 (instead of 4). Display the interest amount rounded upto three decimal places. Even if the result does not have decimal, it should be displayed with suffix “.000”. Consider below sample input and output: Input: 1 1000 10 5 Output:105.000Output is 55 since the interest rate is 10 and no of years is 5. Hence, the final interest will be 10 + 10 percentage of 5, which is 10.5. Hence final answer is 105.000.
Here you will get all the TCS xplore related material.
Compare 2D points for distance from origin Write a program to check distance of 2D points from origin and print the point with highest distance. Create class Point with attributes as below: double x double y In Solution class, define main method to read values for three point objects. Next, create below method in Solution class which will take three point objects as input parameters and return the point with highest distance from origin. public static Point pointWithHighestOriginDistance(Point p1, Point p2, Point p3) Consider sample input as below to read values for six point objects 2 2 3 3 -4 -4 Output: -4.0 -4.0 Solution:
Factorials of input numbers Write a program to read 5 numbers and print factorials of each. (Final answers should be non decimal numbers). Example: Input: 2 3 4 6 5 Output: 2 6 24 720 120 Solution:
Find Docs with Odd Pages Create class Document with below attributes id – int title – String folderName – String pages – int Write getters, setters and parameterized constructor as required. Create class Solution with main method. Implement static method – docsWithOddPages in Solution class. This method will take array of Document objects and return another array with Document objects which has odd number of pages. This method should be called from main method and display values of returned objects as shared in the sample (in ascending order of id attribute). Before calling this method, use Scanner object to read values for four Document objects referring attributes in the above sequence. Next call the method and display the result. Consider below sample input and output: Input: 1 resume personal 50 2 question1 exams 55 3 question2 exams 45 4 India misc 40 Output (each line has values separated by single space): 2 question1 exams 55 3 question2 exams 45
Shirt Discount, Price Class Solution has predefined main method to read values and display the results. main method reads the value for five objects of class Shirt. It also calls methods – getDiscountPrice and getShirtWithMoreThanSpecificPrice defined in same Solution class. Code inside main method should not be altered else your solution might be scored as zero. You may copy the code from main method in eclipse to verify your implementation. Guidelines to implement the code: Create class Shirt with attributes: int tag String brand double price char gender Create constructor which takes parameters in above sequence. Create getters and setters for these attributes. Next, in Solution class, define two static methods as below: public static double getDiscountPrice(Shirt s): This method will return the discounted price based on gender for the Shirt object which is passed as input parameter. If gender is ‘m’ then discount is 10%. For ‘f’ it is 20% and for ‘u’ it is 30%. public static Shirt getShirtWithMoreThanSpecificPrice(Shirt shirts,double price): This method will take array of Shirt objects and price value. The method will return array of Shirt objects with more than specified price in ascending order of price. Main method already has Scanner code to read values, create objects and test above methods. Main method reads values for five Shirt objects, followed by price. Price will be input for method getShirtWithMoreThanSpecificPrice. You can consider below sample input and output to verify your implementation before submitting in Hackerrank. Sample input: 1 arrow 500 m 2 bare 600 f 3 arrow 400 m 4 bare 300 m 5 arrow 1000 u 500 Sample output: 450.0 480.0 360.0 270.0 700.0 2 600.0 bare 5 1000.0 arrow
Create class Book with below attributes: id – int title – String author – String price – double Write getters, setters and parameterized constructor as required. Create class Solution with main method. Implement static method – searchTitle in Solution class. This method will take a parameter of String value along with other parameter as array of Book objects. It will return array of books where String value parameter appears in the title attribute (with case insensitive search). This method should be called from main method and display id of returned objects in ascending order. Before calling this method, use Scanner object to read values for four Book objects referring attributes in the above sequence. Next, read the value search parameter. Next call the method and display the result. Consider below sample input and output: Input: 1 hello world aaa writer 50 2 World cup bbb writer 55 3 Planet earth ccc writer 45 4 India’s history ddd writer 40 WORLD Output: 1 2
About Tcs – first quiz4.97Tata Indica1968Co innovation networkJamsetji Code of Conduct •Prohibited•No•All except calendar•Refrain•All except prohibited drug use IT Consulting Industry•True•All of them•Nolan and bennigson•1900•IT consulting IndustryBusiness 4.0 •Working Mother & AVTAR •Technology partner •2017 •Intelligent agile automated on cloud •Abundance of capital & talent Digital awareness1.Big data •IBM Watson •puppet •volume,velocity, variety, veracity •velocity …
Handson-1 Employee Count select Departments.deptName,COUNT(Employees.eDeptId) From departments LEFT Join Employees on Departments.deptId=Employees.eDeptId Group By Departments.deptId,Departments.deptName Order by count(Employees.eDeptId) Desc, departments.deptName; Handson -2 Display Department Details select Dept_Id,Dept_Name from Department where Dept_Location=’Ground Floor’; Handson – 3 Display non-Programmer Department name select distinct Dept_name from Departments,Employees where Dept_ID=Emp_Dept_Id and Dept_name not in (select distinct Dept_name from Departments,Employees …
Handson-1 Print Customer Details declare id Orders.C_ID%type; i Customers.ID%type; n Customers.Name%type; cn Customers.Contact_No%type; cursor o is select C_ID from Orders where QUANTITY >200; cursor c is select ID, Name, Contact_No from Customers; begin dbms_output.put_line(‘Customer_Id Customer_Name Customer_Phone’);open o; loop fetch o into id; exit when o%notfound; open c; loop fetch c into i,n,cn; exit …