-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChocolate.java
More file actions
21 lines (21 loc) · 994 Bytes
/
Chocolate.java
File metadata and controls
21 lines (21 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* @class: Chocolate
* @author: Hugo Padilla
* @course: ITEC 2140 - 05, Spring 2023
* @version: 1.0
* @date: February 1st, 2023
* @description: This will calculate a new quantity of bags with 3 chocolates
* as opposed to having an initial quanity of bags with 2 chocolates.
* My variables are bagsIntial, chocolateInitial, chocolateFinal, chocolate, and bagsFinal.
*/
public class Chocolate {
public static void main(String[] args) {
int bagsInitial = 9;
int chocolateInital = 2;
int chocolateFinal = 3;
int chocolate = bagsInitial * chocolateInital; // Calculates the total amount of chocolate available.
int bagsFinal = chocolate / chocolateFinal; // Takes the total amount of Chocolate and calculates new amount of bags needed.
System.out.println("The total amount of bags needed will be " + bagsFinal +".");
System.out.println("These bags contain " +chocolateFinal + " chocolates each." );
}
}