Losing weight has never been so easy!

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN

and now it's even easier...

Post by Stoves »

Code: Select all

DIM originalWeight AS DOUBLE, weight AS DOUBLE
DIM milesRanPerDay AS INTEGER, foodsEatenPerDay AS INTEGER
DIM day AS LONG

CLS

INPUT "Current weight (in pounds)"; originalWeight
INPUT "How many miles do you run per day"; milesRanPerDay
INPUT "How much food (in pounds) do you eat per day"; foodsEatenPerDay

CLS

weight = originalWeight
milesRanPerDay = milesRanPerDay + 100
foodsEatenPerDay = 0

PRINT "Here's your diet:"
PRINT "Eat " + LTRIM$(RTRIM$(STR$(foodsEatenPerDay))) + " pounds of food a day."
PRINT "RUN " + LTRIM$(RTRIM$(STR$(milesRanPerDay))) + " miles a day."
easy$ = INPUT$(1)
CLS

day = 0
DO
day = day + 1

CLS
PRINT "Day " + LTRIM$(RTRIM$(STR$(day)))
PRINT "Current Weight: " + LTRIM$(RTRIM$(STR$(INT(weight))))

weight = weight - INT(milesRanPerDay * .05) + INT((foodEatenPerDay - (milesRanPerDay * .02) * .05))

PRINT
PRINT "Running " + LTRIM$(RTRIM$(STR$(milesRanPerDay))) + " miles today";
SLEEP 1
FOR x = 0 TO 3
PRINT ".";
SLEEP 1
NEXT

LOOP UNTIL weight < 1
IF weight < 0 THEN weight = 0

CLS
PRINT "Tadaaaaa! You lost " + LTRIM$(RTRIM$(STR$(originalWeight))) + " pounds in only " + LTRIM$(RTRIM$(STR$(day))) + " days!"
PRINT "You now weigh a lean 0 pounds."
INPUT "Now wasn't that easy"; easy$
PRINT "Shut up. You're dead."
END
User avatar
Pete
Site Admin
Posts: 887
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete »

I read this title and I was sure it was going to be spam. It's nice to be pleasantly surprised!
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Post by sid6.7 »

ARF!...well it was i just delete the first part...i saw stoves code
i went oh neat....! so left that...

:oops: :D
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Ohs noes! The spambot ate his soul! :wink:
Image
Post Reply