Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7509005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:47:10+00:00 2026-05-29T22:47:10+00:00

I have gotten this to work nicely, but when speed hits a certain speed

  • 0

I have gotten this to work nicely, but when speed hits a certain speed it want it to stay that speed and not increase. The code does this to an extent, but when I am printing out the values one the the values hit 270 and then drops back down to 250. I do not want it so surpass 250 ever. Also the decent variable keeps moving up should it not stay the same value when max speed is hit or is this right and it is behaving right it just looks wrong to me? What I am getting at is should the distance traveled be more if the object has hit terminal velocity which i set to 250 every second ? Or do I have to set up the code differntly? Like have an if statement in there to say if mySpeed = maxSpeed then only use a certian decent rate? Well this is straight out of a physics book so…
Thanks for any help

     using System;
     using System.Collections.Generic;
     using System.Linq;
     using System.Text;

    namespace JumpSimR
    {
      class Program
      {
    static void Main(string[] args)
    {
        //non modifiable constants
        const double maxSpeed = 250; //terminal velocity
        const double g = 32.17; //imeriial unity feet per sec g = dv/dt

        //variablbes used for player
        double mySpeed;         //current spped of person
        double myAlt;           //altitude of the person
        double myDist;          //distance travled for jump
        double t;               //time in simulation
        //parachute variables
        bool deploy;
        bool lCord;
        bool rCord;


        double alt;

        //get the alttitude from user input
        Console.WriteLine("Enter Jump Altitued:");
        Console.WriteLine("a for 30000 Ft");
        Console.WriteLine("b for 25000 Ft");
        Console.WriteLine("c for 15000 Ft");
        String alt1 = Console.ReadLine();
        if (alt1.Equals("a"))
        {
            alt = 30000;
        }
        else if (alt1.Equals("b"))
        {
            alt = 25000;
        }
        else { alt = 15000; }
        Console.WriteLine("The Hight of the jump is " + alt);

        myAlt = alt; //assign player alt to jump hight
        t = 1;
        mySpeed = 0;
        deploy = false;

        while(myAlt > 0)
        {
            if (maxSpeed > mySpeed){
                mySpeed = g * t;
            }
            else if (mySpeed >= maxSpeed) 
            {
                mySpeed = maxSpeed;
            }

            myDist = mySpeed * t; //distace = velocity * time

            if (0 > myAlt - myDist) { myAlt = 0; } else { myAlt -= myDist; } //subtract distance travled from starting alt
            Console.WriteLine("My Speed: " + mySpeed);
            Console.WriteLine("My Distance: " + myDist);
            Console.WriteLine("Altitude: " + myAlt);
            t++;

        }

        // keep screen from going away
        // when run from VS.NET
        Console.ReadLine();

    }
}
        }  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:47:10+00:00Added an answer on May 29, 2026 at 10:47 pm

    Take out the else, you were allowing it to pass the max for that one iteration:

            if (maxSpeed > mySpeed){
                mySpeed = g * t;
            }
            if (mySpeed >= maxSpeed) 
            {
                mySpeed = maxSpeed;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched for this a little but I have not gotten a particularly straight
I have gotten this to work a bit but can't seem to figure out
I guess the topic says it. I have tried googling this, but havent gotten
I have never gotten this to work. What the heck am I doing wrong?
I have some code that I am trying to make it play nicely with
I have been trying to figure out a way to make this work, but
I have a list of System.DirectoryServices.ActiveDirectory.Domain objects gotten via this method. How do I
I have tried for three days now and gotten nowhere on this.... I absolutely
I have been struggling with getting this to work for a number of days
So I have been trying to get this to work 2 days and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.