# Cooking Time Calculator

Page 1 of 1

## 5 Replies - 488 Views - Last Post: 18 April 2019 - 09:56 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=415800&amp;s=73b6e341b090cffd052cd0e00d7369fd&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 DoomDemolisher

Reputation: 0
• Posts: 4
• Joined: 14-March 19

# Cooking Time Calculator

Posted 18 April 2019 - 08:53 AM

I am trying to create a program that asks which food someone wants to cook, the asks them how many pounds of that food they would like to cook at once. After this it is supposed to calculate the amount of time it would take to cook the food. I'm trying to get the program to show how ling it will take in hours and minutes, but when I try to divide the minutes by 60, it gives me a number like, 3.33333333 hours.

```start:
Textwindow.Clear()
Textwindow.Write("Do you want to cook Beef, Chicken, Turkey, or Pork? ")

If food = "beef" Then
Goto beef
ElseIf food = "chicken" Then
Goto chicken
ElseIf food = "turkey" Then
Goto turkey
ElseIf food = "pork" Then
Goto pork
EndIf

beef:
Textwindow.Write("How many pounds of beef do you want to cook? ")
Goto beefweight

chicken:
Textwindow.Write("How many pounds of chicken do you want to cook? ")
Goto chickenweight

turkey:
Textwindow.Write("How many pounds of turkey do you want to cook? ")
Goto turkeyweight

pork:
Textwindow.Write("How many pounds of pork do you want to cook? ")
Goto porkweight

beefweight:
Textwindow.WriteLine("The current time is: " + Clock.Hour + ":" + Clock.Minute + ":" + Clock.Second + ".")
weight = beef * 40
time = weight / 60
Goto beeftime

chickenweight:
Textwindow.WriteLine("The current time is: " + Clock.Hour + ":" + Clock.Minute + ":" + Clock.Second + ".")
weight = chicken * 25
time = weight / 60
Goto chickentime

turkeyweight:
Textwindow.WriteLine("The current time is: " + Clock.Hour + ":" + Clock.Minute + ":" + Clock.Second + ".")
weight = turkey * 30
time = weight / 60
Goto turkeytime

porkweight:
Textwindow.WriteLine("The current time is: " + Clock.Hour + ":" + Clock.Minute + ":" + Clock.Second + ".")
weight = pork * 20
time = weight / 60
Goto porktime

beeftime:
Textwindow.WriteLine("You will need to cook your beef for " + time + " hours ")
Textwindow.Write("Is this time ok? ")
If choice = "yes" Then
Program.End()
ElseIf choice = "no" Then
Goto start
EndIf

chickentime:
Textwindow.WriteLine("You will need to cook your chicken for " + time + " hours ")
Textwindow.Write("Is this time ok? ")
If choice = "yes" Then
Program.End()
ElseIf choice = "no" Then
Goto start
EndIf

turkeytime:
Textwindow.WriteLine("You will need to cook your turkey for " + time + " hours ")
Textwindow.Write("Is this time ok? ")
If choice = "yes" Then
Program.End()
ElseIf choice = "no" Then
Goto start
EndIf

porktime:
Textwindow.WriteLine("You will need to cook your pork for " + time + " hours ")
Textwindow.Write("Is this time ok? ")
If choice = "yes" Then
Program.End()
ElseIf choice = "no" Then
Goto start
EndIf

```

Is This A Good Question/Topic? 0

## Replies To: Cooking Time Calculator

### #2 modi123_1

• Suitor #2

Reputation: 14995
• Posts: 59,870
• Joined: 12-June 08

## Re: Cooking Time Calculator

Posted 18 April 2019 - 09:02 AM

You neglected to ask a question.

### #3 astonecipher

• Senior Systems Engineer

Reputation: 2836
• Posts: 11,132
• Joined: 03-December 12

## Re: Cooking Time Calculator

Posted 18 April 2019 - 09:26 AM

```Goto beefweight
```

That is some of the nastiest code I have seen in a while.

### #4 modi123_1

• Suitor #2

Reputation: 14995
• Posts: 59,870
• Joined: 12-June 08

## Re: Cooking Time Calculator

Posted 18 April 2019 - 09:33 AM

@astone - totes.. much worse than beefsquatch.

### #5 astonecipher

• Senior Systems Engineer

Reputation: 2836
• Posts: 11,132
• Joined: 03-December 12

## Re: Cooking Time Calculator

Posted 18 April 2019 - 09:52 AM

### #6 DarenR

• D.I.C Lover

Reputation: 602
• Posts: 3,993
• Joined: 12-January 10

## Re: Cooking Time Calculator

Posted 18 April 2019 - 09:56 AM

youre using clock items but not in the math?

all you are basically doing is simple math and expecting times to be outputted?
how is the program supposed to know you want datetime? (time)