Calculate total water drunk in a day I would like to know how I might improve my code?
I just started coding and liking it a few days ago so I am quite new to this whole world...

The objective is to calculate the amount of water one has drunk in a day. Depending on the user's input, the app tells him or her if the amount of water drunk is great or not. 

Now I would like know how I might improve this whole code?
And I'd be grateful for some advice (what I could improve etc)...

package com.ahmed.everything;
import java.util.*;
import java.util.concurrent.TimeUnit;

public class DrinkingWater {
    public static void main(String [] args) throws Exception {
    Scanner sc = new Scanner(System.in);

    System.out.print("Amount of water your bottle can hold: ");
    // entering amount of water bottle can hold
    double litre = sc.nextDouble();
    System.out.print("How many bottles have you drunk today? : ");
    // amount of bottles for today
    double bottles = sc.nextDouble(); 
    // calculating water drunk
    double total = (bottles * litre);

    // result
    if (bottles == 1) {
    System.out.print("You've only drunk one bottle today! :(" + "\n");
    }
    else {
        System.out.println("Today, you have drunk " + bottles + " bottles. Which equals to " + total + " liters of water.");
    }

    // advice
    if (total &lt; 4) {
        System.out.println("You did not drink enough water, drink at least 4 liters to stay healthy!");
    }

    else if (total &gt;= 4) {
        System.out.println("Good job! You've drunk enough water today! :)");
    }
    else;


    //short time span
    TimeUnit.SECONDS.sleep(1);
    System.out.print(".");
    TimeUnit.SECONDS.sleep(1);
    System.out.print(".");
    TimeUnit.SECONDS.sleep(1);
    System.out.println(".");
    TimeUnit.SECONDS.sleep(1);

    System.out.println("Did you like our little app? Please review it from 1-5. 1 being considerer as very good and 5 as very bad.");
    int note = sc.nextInt();
    if (note &lt;= 4 || note &gt;= 1) {
        System.out.println("Thanks for your review.");
    }else {
        System.out.println("That's better, we'll do our best the next time");
    }

    }
}
Check your if expression in review part:


if (note &lt;= 4 || note &gt;= 1) {
    System.out.println("Thanks for your review.");
}else {
    System.out.println("That's better, we'll do our best the next time");
}



This will always print "Thanks for your review" since whatever the value of note will be always true either for &lt;= 4 or &gt;= 1.

Using an IDE (for example IntelliJ, netbeans, eclipse) helps you mitigate this kind of problems, but it's still better to always review your code.





Confusing result and advise:

I'm not sure if the application is happy that I drank enough water or sad because I only drank 1 bottle. 

As stated in your question:


  The objective is to calculate the amount of water one has drunk in a
  day. Depending on the user's input, the app tells him or her if the
  amount of water drunk is great or not.


Then I think you don't need to tell them how many bottles they drink or at least remove the sad face to avoid confusion.





User input problems:

Case 1: What if the user input a letter instead of number? This will happen:



Case 2: What if the user input a negative number? Then this will happen:



As you can see in case 1, this will break your program. Although in case 2 the program will not crash, I think it's impossible to drink negative amount of water.

To solve this kind of issue, you can use try/catch expression. Something like this:

double litre = 0;
boolean isInvalidInput = false;
do {
    try {
        System.out.print("Amount of water your bottle can hold: ");
        // entering amount of water bottle can hold
        litre = sc.nextDouble();
        isInvalidInput = false;
    } catch (InputMismatchException e) {
        isInvalidInput = true;
    }
    sc.nextLine();
} while(isInvalidInput || litre &lt; 0);


If you use the code above, this will be the output:



As you can see, the program will ask the same question repeatedly until the user enters a correct input