Open
Conversation
swsms
reviewed
Oct 15, 2018
src/coffeeMachine/Main.java
Outdated
| int coffee = cups * 15; | ||
| System.out.print("Write how many cups of coffee you will need: "); | ||
| System.out.println(cups); | ||
| System.out.print ("For "); |
Contributor
There was a problem hiding this comment.
I do not think that it is good to use an additional space after print (before parentheses).
It is better to write System.out.print("For ");
Contributor
There was a problem hiding this comment.
I think it is better to give more descriptive names of your commits rather than commit and again.
Author
|
Check if there are enough resources |
artyom-b
reviewed
Oct 17, 2018
| if( min==cups) { | ||
| System.out.println("Yes, I can make that amount of coffee"); | ||
| } | ||
| if( min<cups) { |
There was a problem hiding this comment.
Maybe is it better to use if-else construction here?
| int coffee = scanner.nextInt(); | ||
| System.out.println ("Write how many cups of coffee you will need: "); | ||
| int cups = scanner.nextInt(); | ||
| int amount_w = water/200; |
There was a problem hiding this comment.
In Java, it is better to add one space between an operator and operands like water / 200;
Author
|
Thank you very much, Artyom! :)
Отправлено из мобильной Почты Mail.Ru
среда, 17 октября 2018 г., 17:06 +0300 от notifications@github.com <notifications@github.com>:
…
@artyom-b commented on this pull request.
----------------------------------------------------------------------
In src/coffeeMachine/Main.java :
> +int amount_m = milk/50;
+int amount_c = coffee-cups /15;
+int[] amount = {amount_w,amount_m,amount_c};
+int min = amount[0];
+for (int i=0;i<3;i++)
+{
+ if (amount[i]<min)
+ {
+ min = amount[i];
+ }
+}
+
+ if( min==cups) {
+ System.out.println("Yes, I can make that amount of coffee");
+ }
+ if( min<cups) {
Maybe is it better to use if-else construction here?
----------------------------------------------------------------------
In src/coffeeMachine/Main.java :
> public class Main {
public static void main(String[] args) {
- System.out.print("Hello world!");
+ Scanner scanner = new Scanner(System.in);
+ System.out.println("Write how many ml of water the coffee machine has: ");
+ int water = scanner.nextInt();
+ System.out.println ("Write how many ml of milk the coffee machine has: ");
+ int milk = scanner.nextInt();
+ System.out.println ("Write how many grams of coffee beans the coffee machine has: ");
+ int coffee = scanner.nextInt();
+ System.out.println ("Write how many cups of coffee you will need: ");
+ int cups = scanner.nextInt();
+int amount_w = water/200;
In Java, it is better to add one space between an operator and operands like water / 200 ;
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub , or mute the thread .
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.