Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignments 1,2,3,4 #25

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Conversation

shreyakishore
Copy link

No description provided.

@shreyakishore shreyakishore changed the title Assignment 1 almost done Assignment 1 and 2 completed Jan 11, 2020
@shreyakishore shreyakishore changed the title Assignment 1 and 2 completed Assignments 1,2 completed Jan 13, 2020
@shreyakishore shreyakishore changed the title Assignments 1,2 completed Assignments 1,2,3 completed Jan 14, 2020
@shreyakishore shreyakishore changed the title Assignments 1,2,3 completed Assignments 1,2,3 Jan 15, 2020
@shreyakishore shreyakishore changed the title Assignments 1,2,3 Assignments 1,2,3,4 Jan 16, 2020
Copy link
Collaborator

@thejasn thejasn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please run PMD and checkstyle on files and use gitignore

assignment1/src/com/company/main/Details.java Outdated Show resolved Hide resolved
Comment on lines 108 to 126
public static class Tax {
public double getTax(Item item) {
double tax=0;
switch (item.getType()) {
case RAW:
tax = item.getPrice() * 0.125;
break;
case MANUFACTURED:
tax = item.getPrice() * 0.125 + (item.getPrice() * 0.125 + item.getPrice()) * 0.02;
break;
case IMPORTED:
tax = 0.1 * item.getPrice();
if (tax <= 100) tax += 5;
else if (tax <= 200) tax += 10;
else tax += 0.05 * (item.getPrice() + tax);
break;
}
return tax*item.getQuantity();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • why a static class ??
  • code formatting
  • default case
  • explore richer enums provided in java 11

assignment1/src/com/company/main/Item.java Outdated Show resolved Hide resolved
assignment1/src/com/company/main/Item.java Outdated Show resolved Hide resolved
assignment1/src/com/company/main/Item.java Outdated Show resolved Hide resolved
assignment2/src/com/company/main/Main.java Show resolved Hide resolved
assignment2/src/com/company/main/Main.java Show resolved Hide resolved
assignment2/src/com/company/main/Student.java Outdated Show resolved Hide resolved
assignment2/src/com/company/main/Student.java Outdated Show resolved Hide resolved
assignment2/src/com/company/main/Student.java Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants