Results 1 to 10 of 10

Thread: project help

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    5

    project help

    This is my project and I'm trying to calculate the total cost for gas for a chevy and a buick on a form. The total miles is 21 for city and 33 for freeway. I'm also putting in the mpg for each, for city and freeway. How would I set up the labels to display the right amount? Do I use If Then statements? Thanks!
    Attached Images Attached Images  

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: project help

    You can take a screen shot with something like this:

    http://windows.microsoft.com/en-US/w...e-print-screen

    which will be a whole lot easier than a photo.

    What is the mileage and Total Miles? How do those get entered? You would certainly use an If statement to deal with the two radio button pairs. The outer If statement would be for the car, the inner If statement for both would be the Route. However, it seems like you would want a slightly more complicated model where part of the route is freeway and the rest is city, which wouldn't work with that interface, but I already don't see how mileage is entered.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    5

    Re: project help

    Quote Originally Posted by Shaggy Hiker View Post
    You can take a screen shot with something like this:

    http://windows.microsoft.com/en-US/w...e-print-screen

    which will be a whole lot easier than a photo.

    What is the mileage and Total Miles? How do those get entered? You would certainly use an If statement to deal with the two radio button pairs. The outer If statement would be for the car, the inner If statement for both would be the Route. However, it seems like you would want a slightly more complicated model where part of the route is freeway and the rest is city, which wouldn't work with that interface, but I already don't see how mileage is entered.
    That's what I'm trying to figure out, this is for an online class.
    -The Buick gets 23.7 miles per gallon on the freeway and 15.5 miles per gallon in the city.

    -The Chevy gets 29.3 miles per gallon on the freeway and 19.8 miles per gallon in the city.

    -Freeway distance is 33 miles.

    -City driving distance is 21 miles

    So the numbers are constants and don't change. I just need to figure out how to get them to show up when the appropriate radio button is selected.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: project help

    Oh, that does make it a bit simpler. It looks like you have those labels fairly well figured out, as the labels for mileage and total distance certainly look right. What do you have written?
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    5

    Re: project help

    Quote Originally Posted by Shaggy Hiker View Post
    Oh, that does make it a bit simpler. It looks like you have those labels fairly well figured out, as the labels for mileage and total distance certainly look right. What do you have written?
    I haven't started yet. The image is just what I need my project to look like. My guess would be to write:

    If BuickRadioButton.checked and
    FreewayRadioButton.checked then
    MileageLabel.Text = "15.5" and
    TotalMilesLabel.Text = "21"

    Would that be right?

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    5

    Re: project help

    I attached what I need exactly.
    Attached Images Attached Images

  7. #7
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: project help

    Quote Originally Posted by Shaggy Hiker View Post
    You can take a screen shot with something like this:
    Should be on every computer's quick launch next to "everything"

    http://gyazo.com/

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: project help

    Quote Originally Posted by ident View Post
    Should be on every computer's quick launch next to "everything"

    http://gyazo.com/
    That does look more versatile than the default screen capture, but screen capture is pretty good for grabbing one whole form or the whole screen.

    As for the If statements, those would work. You'd need a fair set of them, but you will anyway you write it. The one thing I would say is that you should use AndAlso rather than And.
    My usual boring signature: Nothing

  9. #9
    PowerPoster Evil_Giraffe's Avatar
    Join Date
    Aug 2002
    Location
    Suffolk, UK
    Posts
    2,555

    Re: project help

    Quote Originally Posted by Shaggy Hiker View Post
    You would certainly use an If statement to deal with the two radio button pairs.
    Not necessarily, but I'm guessing that objects haven't been introduced yet in the course.

  10. #10
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: project help

    Oh yeah, I'd REALLY be guessing that way. For this exercise, I think that If statements are pretty much the only option available.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width