School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,103 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,019 people online right now. Registration is fast and FREE... Join Now!




logical errors

 

logical errors, weight loss program assigning levels

chas_smith

6 Nov, 2009 - 09:46 PM
Post #1

New D.I.C Head
*

Joined: 6 Nov, 2009
Posts: 2

Hi

I am new sorry if this is in the wrong place.
making a program to help me loses pounds ,currently 295 pounds ohmy.gif and that needs to change so lets go the geek route make a game of it (sort of)
I am using open office calc program to keep track of imputed data on my wight loose

now this is what I was thinking (and having difficulty with)

there are 100 character levels in my "game" so ..

(weight-goal weight) / 100 = amount need to get to next "level"

so now I set up a chart all nice with dates from now tell next year. my current wight and then I will put in my new wight daily

the problem becomes assigning a level based on what I have lost

basically I am just not sure what ... to ... do


anyone want in on this smile.gif or any ideas as to what could be a nice interface


end result wishing to be I put in my wight Vs gole everyday and in one column it gives me a level from 1-100

so if I loose 9 pounds it goes

Wow ok he lost XX amount of pounds that is worth XXX exp
and that much exp = XX levels


anyone that knows of a macro or just math equation help I just cant rap my head around how to show the levels Vs pound loose

and if any of you gods of code out there wish to throw me some short of program that already dose this short of thing then sweet wink2.gif


I think this would really motivate me into doing something about all my fat. making more about getting levels then about loosing pounds just sounds better to me please help in any way you can



*I have dyslexia and I am sorry about poor spelling please don't joke and if need be just ask for about anything spelled poorly

User is offlineProfile CardPM
+Quote Post


Martyr2

RE: Logical Errors

7 Nov, 2009 - 01:42 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 7,307



Thanked: 837 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Below is a small program I drew up for you in C with some comments and constants to make things easier to read showing all calculations.

CODE

#include<stdio.h>
#include<math.h>

#define POUNDSTOLOSE 250.0
#define LEVELS 100.0
#define TOTALEXPPOSSIBLE 1000.0


int main()
{
    int amountLost = 0;

    printf("How many pounds have you lost total: ");
    scanf("%d", &amountLost);

    //lbPerLevel = Pounds to lose / 100 gives you the number of pounds per level.
    float lbPerLevel = POUNDSTOLOSE / LEVELS;

    //expPerLb = Some exp number / Pounds to Lose gives you number of exp per lb.
    float expPerLb = TOTALEXPPOSSIBLE / POUNDSTOLOSE;

    printf("Pounds per Level: %.2f\n", lbPerLevel);
    printf("Experience per pound: %.2f\n", expPerLb);

    //Amount you lost * expPerLb = Total Experience Pts
    float totalpts = (amountLost * expPerLb);

    //lbPerLevel * expPerLb = Amount of experience per level
    float ptsPerLevel = lbPerLevel * expPerLb;

    printf("Your total experience pts: %d\n", (int)totalpts);
    printf("Amount of experience per level: %d\n", (int)ptsPerLevel);

    //Total Experience Pts / Amount of experience per level = Your level
    printf("Your level is %d\n", (int)(totalpts / ptsPerLevel));



    return 0;
}


Should show you all the info you need with regard to pts, pts per pound lost, total experience pts and level to name a few. It has no error checking, but you can adjust the numbers at the top to alter the calculations.

Enjoy!

"At DIC we be experience pt counting ninjas...we use them to get to sleep at night." decap.gif
User is offlineProfile CardPM
+Quote Post

chas_smith

RE: Logical Errors

7 Nov, 2009 - 07:15 AM
Post #3

New D.I.C Head
*

Joined: 6 Nov, 2009
Posts: 2

QUOTE(Martyr2 @ 7 Nov, 2009 - 01:42 AM) *

Below is a small program I drew up for you in C with some comments and constants to make things easier to read showing all calculations.

[code]
#include<std...................





thanks thats about right now to get 'c' lol wink2.gif


I am going to go into this a little bit deeper and maybe add in some other things to make this a more sat driven sheet

I think turning my life into a Wowish style grinding for levels is going to work ...


oh one thing I forgot to ask I am also looking for varying level exp meaning at first the levels come quick but then as it get higher it become more exp needed to level ... because in real life it is easy to sart loosing wight the pound should start to shed off

the hard part comes when you have to do a little more to keep loosing

any ideas
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 12:26PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month