-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (23 loc) · 766 Bytes
/
Main.java
File metadata and controls
30 lines (23 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* @exercise: Zé do Lanche 2
* @author: Rodrigo Andrade
* @date: 25 Feb 2026
* @license: MIT
* @language: Java
* @github: https://github.com/Rorchive/C06
*/
package com.rodrigoandrade;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int firstHourMeals = input.nextInt();
int secondHourMeals = input.nextInt();
int thirdHourMeals = input.nextInt();
input.close();
int totalMeals = firstHourMeals + secondHourMeals + thirdHourMeals;
float averageMeals = (float) (totalMeals / 3.0);
System.out.println("Total Meals: " + totalMeals);
System.out.println("Average Meals: " + averageMeals);
}
}