Since you appear to be struggling, the best way to improve is by actually compiling and running your own code, just reading alone isn't enough, it requires hands-on experience, get involved, write some code, see what happens.
If you do get stuck, then post the code you have written so far and post it here so we can see where the obstacles are and help you to overcome them.
The important thing is to approach the task in small steps. There's no need to have a complete all-singing all-dancing program as a first attempt. Start small and build up one stage at a time.
Indeed, indeed. First, try to implement the function I gave you, UgoChi. After you are able to implement the function to calculate cook time for the chicken, start building up. Create a function convert the time from minutes to hours. Build up from there.
Let’s imagine that you have been contacted by a local restaurant. It seems they are having some trouble with consistency and they need a program to help them determine exactly how long a chicken should cook. Your task is to design a program that would ask the user to input the weight of the chicken and then determine the appropriate cook time using a formula that will be given below. The oven temperature will remain constant so you don’t have to worry about that. For the purposes of this program, the cook time will be 20 minutes per pound plus an additional 15 minutes.
At the end of the program, you will display the “Cook Time Minutes” and the “Total Cook Time”.
This program design will use Functions for each of the key elements. Make sure to name each function appropriately.
THE PROGRAM SPECIFICS:
Function: The program should ask the user to input the weight of the bird rounded to the nearest pound.
The weight should be assigned to an appropriate named variable
For the purposes of this program, the cook time will be 20 minutes per pound plus an additional 15 minutes.
Function: The “Cook Time Minutes” should be calculated using the following mathematical formula
Cook Time Minutes = Weight * 20 + 15
The above formula calculates the total minutes that the chicken would be cooking.
Create a temporary variable called “intMinutes” and assign “Cook Time Minutes” to it.
If the “intMinutes” variable is more than 60, create a loop that will subtract 60 while adding 1 to the “intHours” variable. This loop should continue until the “intMinutes” is less than 60.
Function: Once calculated, display the cook time in total minutes (using “Cook Time Minutes”).
Also display the total cook time in hours and minutes (using “intHours” and “intMinutes”).