Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int daysNumber = Integer.parseInt(scan.nextLine());
- double amountRakiaPerDay, degreesPerDay;
- double degreesForL = 0.0;
- double degreesForLPerDay = 0.0;
- double allLitres = 0.0;
- for(int i = 1; i <= daysNumber; i++){
- amountRakiaPerDay = Double.parseDouble(scan.nextLine());
- degreesPerDay = Double.parseDouble(scan.nextLine());
- allLitres += amountRakiaPerDay;
- degreesForLPerDay += amountRakiaPerDay * degreesPerDay;
- }
- degreesForL = degreesForLPerDay/allLitres;
- System.out.printf("Liter: %.02f\n", allLitres);
- System.out.printf("Degrees: %.2f\n", degreesForL);
- if(degreesForL < 38){
- System.out.println("Not good, you should baking!");
- }
- else if(degreesForL >= 38 && degreesForL <= 42){
- System.out.println("Super!");
- }
- else if (degreesForL > 42){
- System.out.println("Dilution with distilled water!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement