-
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
nuclei Assignments #12
base: master
Are you sure you want to change the base?
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.
Okay.
@@ -0,0 +1,14 @@ | |||
eclipse.preferences.version=1 |
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.
Please don't commit IDE configs, generated code and binary files in git.
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.
okay.
for(int j=0;j<3;j++) { | ||
if (sc.hasNextInt()) { quantity=sc.nextInt();} | ||
else if (sc.hasNextDouble()) { price=sc.nextDouble();} | ||
else if (sc.hasNext()) { type=sc.next();} | ||
} |
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 Streams API. And try to remove if else inside the for-loop.
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.
sure sir.
if (type.equalsIgnoreCase("raw")){ | ||
tax=calRawTax(price); | ||
cost=(price+tax)*quantity; | ||
} | ||
else if (type.equalsIgnoreCase("manufactured")){ | ||
tax=calManufacturedTax(price); | ||
cost=(price+tax)*quantity; | ||
} | ||
else if (type.equalsIgnoreCase("imported")){ | ||
tax=calImportedTax(price); | ||
cost=(price+tax)*quantity; | ||
} | ||
else { | ||
System.out.println("Invalid item type."); | ||
continue; | ||
} |
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.
No description provided.