Problems to be solved by visual basic..Pls.Help me - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problems to be solved by visual basic..Pls.Help me

hello!!
im just new in this field,im still studying as computer programmer in a Tesda school here in our town..

here's the problem,,i hope you can help me solve this tonight..

A car travelled 10 minutes in gravel,15 minutes in sand, 20 minutes in asphalt, 25 minutes in mud..
How can i run this,,that when i type for example 27 minutes so the car will be on the asphalt,,when i type the number of minute the corresponding place will appear in the textbox..

pls help me..pls..
thanks...(",)


**sumtimes we need to break the rules and follow apart,***

Comments

  • MrWhiskersMrWhiskers Posts: 5Member
    im sorry im not following what you are asking.

    please explain a lil better.
  • D3D3 Posts: 5Member
    If I were you, I would use and If, Then, Else Statement, or a Case Select statement. I'm not sure what the coding would be on your version of VB, but on mine the if/then/else is this

    dim minutes as integer

    if minutes < 10 and > 0 then
    messagebox.show("gravel")
    ElseIf minutes > 10 and < 25 then
    messagebox.show("sand")


    and so forth until

    ElseIf minutes > 70 then
    messagebox.show("insert some message")

    You can also use just Else for the last one

    Where I put a message box, you put whatever code the instructor wants

    You can also use a case selection structure, but I don't recall that one quite as well.
Sign In or Register to comment.