CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: grandia

  1. #1
    Join Date
    Jun 2003
    Posts
    2

    grandia

    Here's the senairo..

    Batman is chasing Joker. Joker has Joker Mobile and Batman has Bat Mobile, Joker has a headstart on batman, but batman mobile goes faster than joker mobile. Print out there distance everyhalf hour until batmobile catch up to joker mobile or pass it.

    You can like ask user to put following input.

    What's the Joker Headstart? (cannot be less than 0)
    Note: Batmobile starts at 0
    What's the speed of Joker Mobile?
    What's the speed of Bat Mobile? (cannot be less than Joker Mobile)

    What throw's me off is, how do i actually write a code that prints out there closing distance every half hour until bat mobile catch up to him or passes it. I know i have to use d = r * t formula, but i dont know how to use it in c++ with this following problem..

    Can Anyone please help!
    You'll be god send if you do.

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    One solution is a loop. You could set the loop to be, say 1 unit time, for each iteration.

    Kuphryn

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

Featured