Skip to content

13sachinrokade/Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hi 👋, I'm Sachin Ramchandra Rokade

Languages :

java

Exercise1_2_3

Exercise1_2_3 is Java Project which contain 3 exercise on java problems.

Installation

Use the project build tool maven to manage project, dependencies etc.

Dependencies

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>

Exercise 1

Program for 'Employee' class which print the final salary of 20 days based on given Condition.

  1. Takes the hourly salary, number of hours of work per day of employee as parameter and calculate base salary for 20days.
  2. adds $10 to the base salary of the employee if it is less than $500.
  3. adds $5 daily to salary of employee if the number of hours of work per day is more than 6 hours.

Run Program:

Run Matches.java class - To print the required output.
Classes Details

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"

Exercise 2

Program to print the perimeter and the area of a square, a rectangle and a circle.

  1. Accept the user input for Length, breadth, height, radius
  2. Print result like area and perimeter of shapes on screen.

Run Program:

Run Shapes.java class - To print the required output.
Classes Details

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"

Exercise 3

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.
  1. Load teams parameters from teams.csv file; for each line define the instance for a team;
  2. Print standing of Football teams (ordering by points);
  3. Print standing of Basketball teams (ordering by points);
  4. Load results of the last matches from results.csv file and update teams points based on loaded results;
  5. Print new standing of Football teams (ordering by points);
  6. Print new standing of Basketball teams (ordering by points).

Run Program:

Run Matches.java class - To print the required output.
Classes Details
  • 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"

Sachin Rokade

Connect with me:

https://www.linkedin.com/in/sachin-%e3%82%b5%e3%83%81%e3%83%b3-rokade-%e3%83%ad%e3%82%ab%e3%83%87-74478518a/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors