Basicially I am making a recipe program
The user inputs the amount of ingredients for the recipe for..let say a cake
So it would be for 5 people
500 grams sugar
500 grams salt
500 grams milk
500 grams flour
The program then should add up all the amounts of ingredients, and then divide it by the amount of people the user has inputted, so the program now knows how much is needed for one person.
The user then inputs a new number.
This number will be a new amount of people, lets say 10. The user wants to know how much of each ingredient is needed for 10 people.
So the program multiplies the answer to the last calculation by 10 (for each ingredient)
And it then outputs how much is needed for each ingredient to the user
How do I make this in code?
I have made the UI
![Name: MTyKhdo.png
Views: 44
Size: 34.4 KB]()
The user inputs the amount of ingredients for the recipe for..let say a cake
So it would be for 5 people
500 grams sugar
500 grams salt
500 grams milk
500 grams flour
The program then should add up all the amounts of ingredients, and then divide it by the amount of people the user has inputted, so the program now knows how much is needed for one person.
The user then inputs a new number.
This number will be a new amount of people, lets say 10. The user wants to know how much of each ingredient is needed for 10 people.
So the program multiplies the answer to the last calculation by 10 (for each ingredient)
And it then outputs how much is needed for each ingredient to the user
How do I make this in code?
I have made the UI