Inheritance Exercise 1 - infosys
Monday, 21 November 2022
Inheritance Exercise 1 - infosys
Sunday, 20 November 2022
Association - Exercise 1
Association - Exercise 1
Static - Exercise 1 infosys
Static - Exercise 1
Association - Exercise 1
Association - Exercise 1
Array - Exercise 1 , Calculate and return the sum of all the even numbers present in the numbers array passed to the method calculateSumOfEvenNumbers. Test the functionalities using the main() method of the Tester class.
Array - Exercise 1
String - Exercise 1
String - Exercise 1
Complete the removeWhiteSpaces() method given in the Tester class.
Method Description
removeWhiteSpaces(String str)
Remove all the white spaces from the string passed to the method and return the modified string.
Test the functionalities using the main() method of the Tester class.
Sample Input and Output
Encapsulation - Exercise 1
Encapsulation - Exercise 1
Consider the class Employee given below for representing employees of an organization. It has 5 different instance variables and a method to calculate the total salary based on the jobLevel.
Salary is calculated in the calculateSalary() method.
Make necessary changes to the class by making all the attributes private and by adding necessary accessor and mutator methods thus bringing in Encapsulation.
Saturday, 19 November 2022
Methods - Assignment 3
Methods - Assignment 3
Implement a class Calculator with the instance variable and method mentioned below.
Method Description
sumOfDigits()
Calculate and return the sum of the digits of the num member variable
Test the functionalities using the provided Tester class.
Sample Input and Output
Methods - Exercise 1
Methods - Exercise 1
Implement a class Calculator with the method mentioned below.
Method Description
findAverage()
Calculate the average of three numbers
Return the average rounded off to two decimal digits
Test the functionalities using the provided Tester class.
Sample Input and Output
Hint: For round-off to two decimal digits:
double num1 = 65, num2 = 175;
double num3 = num1/num2;
System.out.println(Math.round(num3*100.0)/100.0);
Free Resume Template
Creating a blog post that discusses the pros and cons of using a resume rule is a great way to provide valuable information to job seekers ...