Jump to content

Search the Community

Showing results for tags 'while loops'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Problem Description (Using “While” Loop Only) Margaret has looked at the wind floating over the prairies for a long time. After these observations, she has created a formula that will describe the altitude of a weather balloon launched from her house. In particular, her equation predicts the altitude A (in metres above the ground) at hour t after launching her balloon is: A=-6t^4 + ht^3 + 2t^2+ t Where h is an integer value representing the humidity as a value between 0 and 100 inclusive? Margaret is curious at what the earliest hour is (if any) that her weather balloon will hit the ground after launch, so long as it is no more than the maximum time, M, that Margaret is willing to wait. You can assume that the weather balloon touches ground when A ≤ 0. Margaret has looked at the wind floating over the prairies for a long time. After these observations, she has created a formula that will describe the altitude of a weather balloon launched from her house. In particular, her equation predicts the altitude A (in metres above the ground) at hour t after launching her balloon is: Where h is an integer value representing the humidity as a value between 0 and 100 inclusive? Margaret is curious at what the earliest hour is (if any) that her weather balloon will hit the ground after launch, so long as it is no more than the maximum time, M, that Margaret is willing to wait. You can assume that the weather balloon touches ground when A ≤ 0. In order to do this, your program should use the formula to calculate the altitude when t = 1, t = 2, and so on, until the balloon touches the ground or t = M is reached. Input Specification The input is two non-negative integers: h, the humidity factor, followed by M, the maximum number of hours Margaret will wait for the weather balloon to return to ground. You can assume 0 ≤ h 100 and 0 < M < 240. Output Specification The output will be one of the following possibilities: The balloon does not touch ground in the given time. The balloon first touches ground at hour: Where T is a positive integer value representing the earliest hour when the balloon has altitude less than or equal to zero. Sample Input 1 30 10 Output for Sample Input 1 The balloon first touches ground at hour: 6 Sample Input 2 70 10 Output for Sample Input 2 The balloon does not touch ground in the given time. Please help......
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.