-
Notifications
You must be signed in to change notification settings - Fork 27
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
Manu WIP #11
base: master
Are you sure you want to change the base?
Manu WIP #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
Need not add binary files in git
if (type.equals("raw")) { | ||
// raw: 12.5% of the item cost | ||
this.tax = (double) (0.125) * price; | ||
} else if (type.equals("manufactured")) { | ||
// manufactured: 12.5% of the item cost + 2% of (item cost + 12.5% of the item | ||
// cost) | ||
this.tax = (double) ((0.125) * price) + (0.2 * (price + (0.125 * price))); | ||
} else if (type.equals("imported")) { | ||
import_tax = (double) (0.1) * price; | ||
tot_price = price + import_tax; | ||
double super_charge = (tot_price <= 100) ? 5 : (tot_price <= 200) ? 10 : 0.5 * (tot_price); | ||
this.tax = import_tax + super_charge; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider leveraging java's inheritance property to make the code cleaner and scalable.
class TestAssignment1 { | ||
|
||
@Test | ||
void test_for_type_row() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must write test for edge cases also.
@Order(1) | ||
@DisplayName("Validating String and Empty field") | ||
void test_String_and_Empty_Field() { | ||
Input input = new Input(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expect more test cases.
import java.util.Map; | ||
import java.util.Scanner; | ||
|
||
public class DependencyGraph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can improve on code structure.
if (type.equals("raw")) { | ||
// raw: 12.5% of the item cost | ||
this.tax = (double) (0.125) * price; | ||
} else if (type.equals("manufactured")) { | ||
// manufactured: 12.5% of the item cost + 2% of (item cost + 12.5% of the item | ||
// cost) | ||
this.tax = (double) ((0.125) * price) + (0.2 * (price + (0.125 * price))); | ||
} else if (type.equals("imported")) { | ||
import_tax = (double) (0.1) * price; | ||
tot_price = price + import_tax; | ||
double super_charge = (tot_price <= 100) ? 5 : (tot_price <= 200) ? 10 : 0.5 * (tot_price); | ||
this.tax = import_tax + super_charge; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using java inheritance property
completed Assignment 1,2,3,4