Question: stuck on what to do for this java code and how to write the code for this exercise 1 usage 4 github-classioem[bet] public class Application
![to write the code for this exercise 1 usage 4 github-classioem[bet] public](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2f1f2bc2da_68266f2f1f25d871.jpg)
1 usage 4 github-classioem[bet] public class Application i 2 vages 4 githubiclussoemibot] public static vold Lifetimesupplyf) If Progran - Conputing a Lifetine supply of your favonite snack! 11 If You just won a Lifetine supply of your favorite stack. if If You are going to write a plece of code which altu deterodne how much you 11 witl actually need to last the rest of your lffe. 11 II step one: If Pronpt the user for three things. If : The nane of theif tavorite gnack. If - The nunber of ltens of that snack they nookd eat in a day. If t Their current age. f If store eoch of these things in descriptively nesed variabtes. ff If step tes: If Calculate how many they woutd nege to last the untit they ace 100 . (f) If hent: There are 365 bays 1n a year. Toltipty that by the neaberi of years until they are 100 years old. If (100 ainus their current age) that ali give yeo the totel nober of dayd: cisionMaking LifetimeSupply sre main java com kenzie lifetimesupply \& Application \& rfetimeSupply =S Current file * E.md 11 Step Two: II Calculate hom sany they nould need to last then until they are 100! 11 11 Hint: There are 365 days in a year. Hultiply that by the number of years until they are 100 years II (100 ainus their current age) That will give you the total number of days. 1/ Then nultiply that by how many they would eat in a day. fl. 1/ store that number in a variable. That is hon nany they will eat in their lifetine. II If Step Three: I/ Print a message to the console informing the user ahat they have non. ff II Your sentence should describe how many of their snack they will eat. Sonething like this: 11 II "Congratulations, you have non a Lifetine supply of Snickers!" 1/ "You will receive 2 Snickers per day, for a grand total of 51100 Snickers." df I/ Concatenate together strings aith your variables to forn the bessage dynanically. If 11 Then test out your progran with different numbers and snack! Systen.out.printzni("Congratuiations! You have won a lifetime supply of your favorite snack!") I II Write your code here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
