need help...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Corey Dyke

    #1

    need help...

    K here's the situation, attached is a copy of the lab i have due next week.
    But I won't be around for the next few days, so I 've gotta get it done
    ASAP. but it's driving me crazy.

    We have to design a windows application for children to use for simple
    arithmetic. They must have an option button to bring up a modal dialog
    which allows them to choose non-zero single digit numbers, double digit
    numbers, or one of each. They can also specify a seed for the random number
    generator. The application also has to validate any numbers received.

    Here are the problems i'm having with it:

    label_Click method: when you click on the label it's supposed to cycle
    between +. -. * and / I can't seem to get this to work no matter what I try.

    All in all I can't really pick heads nor tails of how to go about it. Going
    to spend time tomorrow with my instructor, to see if he can clarify what i
    need. But thought I'd look for help on here too, as I've gotten good help
    here before.

    Also, i'm not looking for people to give me code, but just to point me in
    the right direction with a good explanation, or a point to a good resource.

    Thanks,

    Corey


  • Champika Nirosh

    #2
    Re: need help...

    Hi,

    You problem is not clear and the attachement also not there...
    but ....

    label_Click method: when you click on the label it's supposed to cycle
    between +. -. * and / I can't seem to get this to work no matter what I try.

    for this you can do some thing like this

    define this global pointer variable
    private int lintMyPoint = 0;

    define this string array as well
    private string[] larstrMyData = new string[] {"*", "+", "-" etc}

    in you a label_Click()
    {
    if (larstrMyData.L ength > lintMyPoint)
    lintMyPoint ++;
    else
    lintMyPoint = 0;
    label.Text = larstrMyData[lintMyPoint];
    }

    If I got it correctly this way it should solve it

    Nirosh.
    "Corey Dyke" <newfiesrule69@ hotmail.com> wrote in message
    news:KkJgb.6130 $Sg4.2235@edtnp s84...[color=blue]
    > K here's the situation, attached is a copy of the lab i have due next[/color]
    week.[color=blue]
    > But I won't be around for the next few days, so I 've gotta get it done
    > ASAP. but it's driving me crazy.
    >
    > We have to design a windows application for children to use for simple
    > arithmetic. They must have an option button to bring up a modal dialog
    > which allows them to choose non-zero single digit numbers, double digit
    > numbers, or one of each. They can also specify a seed for the random[/color]
    number[color=blue]
    > generator. The application also has to validate any numbers received.
    >
    > Here are the problems i'm having with it:
    >
    > label_Click method: when you click on the label it's supposed to cycle
    > between +. -. * and / I can't seem to get this to work no matter what I[/color]
    try.[color=blue]
    >
    > All in all I can't really pick heads nor tails of how to go about it.[/color]
    Going[color=blue]
    > to spend time tomorrow with my instructor, to see if he can clarify what i
    > need. But thought I'd look for help on here too, as I've gotten good help
    > here before.
    >
    > Also, i'm not looking for people to give me code, but just to point me in
    > the right direction with a good explanation, or a point to a good[/color]
    resource.[color=blue]
    >
    > Thanks,
    >
    > Corey
    >
    >[/color]


    Comment

    • Corey Dyke

      #3
      Re: need help...

      Thanks for the tip, however i did get it working. I just put the label Text
      into a buffer and used if statements to check it and change it where
      necessary.

      yeah for some reason my attachement wouldn't show up...

      here is what my assignment says:

      Create a C# application for children to practice basic arithmetic. The main
      form in the application resembles the following:

      "number 1"
      operator "number 2"
      "answer box" "option button"

      When the option button is clicked, a present a modal dialog to allow the
      user:
      - to choose non zero single digit numbers, double digit numbers, or one of
      each
      - to specify a seed of the random number generator so as to have a
      different set of numbers.

      In addition, your application needs to validate any numbers received.

      the main problem i have now is....

      how do i pass data from my second form, "options", Each of these options
      should directly affect the main form when they are chosen, and then OK is
      clicked. if Cancel is clicked, the changes to not take place.

      i have 2 radio buttons set up for each number (singe digit or double digit)

      also, how do I get the numbers to add/sub/multiply/divide together depending
      on what the sign is?

      i'm still quite a bit lost on the rest...

      thanks

      Corey


      "Champika Nirosh" <cnirosh@textce ntric.lk> wrote in message
      news:eiiVUNWjDH A.2444@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Hi,
      >
      > You problem is not clear and the attachement also not there...
      > but ....
      >
      > label_Click method: when you click on the label it's supposed to cycle
      > between +. -. * and / I can't seem to get this to work no matter what I[/color]
      try.[color=blue]
      >
      > for this you can do some thing like this
      >
      > define this global pointer variable
      > private int lintMyPoint = 0;
      >
      > define this string array as well
      > private string[] larstrMyData = new string[] {"*", "+", "-" etc}
      >
      > in you a label_Click()
      > {
      > if (larstrMyData.L ength > lintMyPoint)
      > lintMyPoint ++;
      > else
      > lintMyPoint = 0;
      > label.Text = larstrMyData[lintMyPoint];
      > }
      >
      > If I got it correctly this way it should solve it
      >
      > Nirosh.
      > "Corey Dyke" <newfiesrule69@ hotmail.com> wrote in message
      > news:KkJgb.6130 $Sg4.2235@edtnp s84...[color=green]
      > > K here's the situation, attached is a copy of the lab i have due next[/color]
      > week.[color=green]
      > > But I won't be around for the next few days, so I 've gotta get it done
      > > ASAP. but it's driving me crazy.
      > >
      > > We have to design a windows application for children to use for simple
      > > arithmetic. They must have an option button to bring up a modal dialog
      > > which allows them to choose non-zero single digit numbers, double digit
      > > numbers, or one of each. They can also specify a seed for the random[/color]
      > number[color=green]
      > > generator. The application also has to validate any numbers received.
      > >
      > > Here are the problems i'm having with it:
      > >
      > > label_Click method: when you click on the label it's supposed to cycle
      > > between +. -. * and / I can't seem to get this to work no matter what I[/color]
      > try.[color=green]
      > >
      > > All in all I can't really pick heads nor tails of how to go about it.[/color]
      > Going[color=green]
      > > to spend time tomorrow with my instructor, to see if he can clarify what[/color][/color]
      i[color=blue][color=green]
      > > need. But thought I'd look for help on here too, as I've gotten good[/color][/color]
      help[color=blue][color=green]
      > > here before.
      > >
      > > Also, i'm not looking for people to give me code, but just to point me[/color][/color]
      in[color=blue][color=green]
      > > the right direction with a good explanation, or a point to a good[/color]
      > resource.[color=green]
      > >
      > > Thanks,
      > >
      > > Corey
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Stu Banter

        #4
        Re: need help...

        Of course it is practise that makes perfect, good to NOT just ask for a full
        solution. May I say using if - then to check for the current string (if
        that's what you meant) and change it to the next value works but is far from
        elegant imho. Using a String [] or enum would probably be both more easy to
        read and to code... Resetting the string counter to 0 could also be achieved
        by using the % operator. May not be faster (don't know really) but very
        easily coded!

        Best!
        Stu


        "Corey Dyke" <newfiesrule69@ hotmail.com> wrote in message
        news:ywXgb.1193 5$Sg4.5603@edtn ps84...[color=blue]
        > Thanks for the tip, however i did get it working. I just put the label[/color]
        Text[color=blue]
        > into a buffer and used if statements to check it and change it where
        > necessary.
        >
        > yeah for some reason my attachement wouldn't show up...
        >
        > here is what my assignment says:
        >
        > Create a C# application for children to practice basic arithmetic. The[/color]
        main[color=blue]
        > form in the application resembles the following:
        >
        > "number 1"
        > operator "number 2"
        > "answer box" "option button"
        >
        > When the option button is clicked, a present a modal dialog to allow the
        > user:
        > - to choose non zero single digit numbers, double digit numbers, or one[/color]
        of[color=blue]
        > each
        > - to specify a seed of the random number generator so as to have a
        > different set of numbers.
        >
        > In addition, your application needs to validate any numbers received.
        >
        > the main problem i have now is....
        >
        > how do i pass data from my second form, "options", Each of these options
        > should directly affect the main form when they are chosen, and then OK is
        > clicked. if Cancel is clicked, the changes to not take place.
        >
        > i have 2 radio buttons set up for each number (singe digit or double[/color]
        digit)[color=blue]
        >
        > also, how do I get the numbers to add/sub/multiply/divide together[/color]
        depending[color=blue]
        > on what the sign is?
        >
        > i'm still quite a bit lost on the rest...
        >
        > thanks
        >
        > Corey
        >
        >
        > "Champika Nirosh" <cnirosh@textce ntric.lk> wrote in message
        > news:eiiVUNWjDH A.2444@TK2MSFTN GP09.phx.gbl...[color=green]
        > > Hi,
        > >
        > > You problem is not clear and the attachement also not there...
        > > but ....
        > >
        > > label_Click method: when you click on the label it's supposed to cycle
        > > between +. -. * and / I can't seem to get this to work no matter what I[/color]
        > try.[color=green]
        > >
        > > for this you can do some thing like this
        > >
        > > define this global pointer variable
        > > private int lintMyPoint = 0;
        > >
        > > define this string array as well
        > > private string[] larstrMyData = new string[] {"*", "+", "-" etc}
        > >
        > > in you a label_Click()
        > > {
        > > if (larstrMyData.L ength > lintMyPoint)
        > > lintMyPoint ++;
        > > else
        > > lintMyPoint = 0;
        > > label.Text = larstrMyData[lintMyPoint];
        > > }
        > >
        > > If I got it correctly this way it should solve it
        > >
        > > Nirosh.
        > > "Corey Dyke" <newfiesrule69@ hotmail.com> wrote in message
        > > news:KkJgb.6130 $Sg4.2235@edtnp s84...[color=darkred]
        > > > K here's the situation, attached is a copy of the lab i have due next[/color]
        > > week.[color=darkred]
        > > > But I won't be around for the next few days, so I 've gotta get it[/color][/color][/color]
        done[color=blue][color=green][color=darkred]
        > > > ASAP. but it's driving me crazy.
        > > >
        > > > We have to design a windows application for children to use for simple
        > > > arithmetic. They must have an option button to bring up a modal[/color][/color][/color]
        dialog[color=blue][color=green][color=darkred]
        > > > which allows them to choose non-zero single digit numbers, double[/color][/color][/color]
        digit[color=blue][color=green][color=darkred]
        > > > numbers, or one of each. They can also specify a seed for the random[/color]
        > > number[color=darkred]
        > > > generator. The application also has to validate any numbers received.
        > > >
        > > > Here are the problems i'm having with it:
        > > >
        > > > label_Click method: when you click on the label it's supposed to[/color][/color][/color]
        cycle[color=blue][color=green][color=darkred]
        > > > between +. -. * and / I can't seem to get this to work no matter what[/color][/color][/color]
        I[color=blue][color=green]
        > > try.[color=darkred]
        > > >
        > > > All in all I can't really pick heads nor tails of how to go about it.[/color]
        > > Going[color=darkred]
        > > > to spend time tomorrow with my instructor, to see if he can clarify[/color][/color][/color]
        what[color=blue]
        > i[color=green][color=darkred]
        > > > need. But thought I'd look for help on here too, as I've gotten good[/color][/color]
        > help[color=green][color=darkred]
        > > > here before.
        > > >
        > > > Also, i'm not looking for people to give me code, but just to point me[/color][/color]
        > in[color=green][color=darkred]
        > > > the right direction with a good explanation, or a point to a good[/color]
        > > resource.[color=darkred]
        > > >
        > > > Thanks,
        > > >
        > > > Corey
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...