Exercise1_2_3 is Java Project which contain 3 exercise on java problems.
Use the project build tool maven to manage project, dependencies etc.
Junit testing tool is required for Testing the class. Add the following dependencies to pom.xml file in Maven Project
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Program for 'Employee' class which print the final salary of 20 days based on given Condition.
- Takes the hourly salary, number of hours of work per day of employee as parameter and calculate base salary for 20days.
- adds $10 to the base salary of the employee if it is less than $500.
- adds $5 daily to salary of employee if the number of hours of work per day is more than 6 hours.
1Code logic for this exercise is in [Employee.java] class. Normal and parametrize test are performed on code logic.
- Employee.java Location: "src\main\java\Employee.java"
2 Test Cases for logic return in EmployeeTest.java and EmployeeTestParameterize.java
- EmployeeTest Location:"src\test\java\EmployeeTest"
- EmployeeTestParameterize Location:"src\test\java\EmployeeTestParameterize"
Program to print the perimeter and the area of a square, a rectangle and a circle.
- Accept the user input for Length, breadth, height, radius
- Print result like area and perimeter of shapes on screen.
1Code logic for this exercise is in [Shapes.java] class. Normal and parametrize test are performed on code logic.
- Shapes.java Location: "src\main\java\shapes.java"
2 Test Cases for logic return in ShapesTest.java and ShapesTestParameterize.java.
- ShapesTest Location:"src\test\java\ShapesTest"
- ShapesTestParameterize Location:"src\test\java\ShapesTestParameterize"
Program to manage the ranking points of different teams.
- FOOTBALL TEAM: Win: add 3 points; Drawn: add 1 point; Lose: do nothing.
- BASKETBALL TEAM: Win: add 2 points; Lose: do nothing.
- Load teams parameters from teams.csv file; for each line define the instance for a team;
- Print standing of Football teams (ordering by points);
- Print standing of Basketball teams (ordering by points);
- Load results of the last matches from results.csv file and update teams points based on loaded results;
- Print new standing of Football teams (ordering by points);
- Print new standing of Basketball teams (ordering by points).
- Teams -Interface
- Matches -Class
- FootballTeam -Class
- BasketballTeam -Class
1 - Code logic for this exercise is in [Matches.java] class. Normal and parametrize test are performed on code logic. Matches is separate class for (main method and logic for problem statement) which access FootballTeam and BasketballTeam Class.
- Matches Location: "src\main\java\Matchess.java"
- Teams Location: "src\main\java\Teams.java"
- FootballTeam Location: "src\main\java\FootballTeam.java"
- BasketballTeam Location: "src\main\java\BasketballTeam.java"
2 -Test Cases for logic return in BasketballTeamTest.java and FootballTeamTest.java
- BasketballTeamTestt Location: "src\test\java\BasketballTeamTest"
- FootballTeamTeste Location: "src\test\java\FootballTeamTest.java"