Page 5 of 6 FirstFirst 123456 LastLast
Results 61 to 75 of 88

Thread: C++ Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Old-Ones Studios Cruise Control's Avatar
    Join Date
    Apr 2005
    Location
    Seattle, WA
    Posts
    3,799

    Default

    I need help, how in blaspheme do I pass data? Can I get an example
    Code:
      float c(float fa, float ce);
      float f(float fa, float ce);
    
     int main()
      {
       float choice; //Stored for intial choice.
    
       cout << "This will convert fahrenheit to celsius.";
       cout << "What do you want to start with, enter your number than print enter.\n";
       cout << " 1. Fahrenheit\n";
       cout << " 2. Celsius\n";
       cin >> choice;
    
       if (choice==1)
        f();
       else
        c();
     return 0;
    }
    
    float c(float fa, float ce)
    {
     float fa; //Fahrenheit variable.
     float ce; //Celsius variable.
    
     cout << "Input your fahrenheit vaulue and press\nENTER.\n";
     cin >> ce;
     fa=1.8*ce+32;
    }
    
    float f(float fa, float ce)
    {
     float fa; //Fahrenheit variable.
     float ce; //Celsius variable.
     cout << "Input your celsius vaulue and press\nENTER.\n";
     cin >> fa;
     ce=(fa-32)/1.8;
    
    }
    Last edited by Cruise Control; 03-23-2006 at 04:46 PM.
    Leave some shards under the belly
    Lay some grease inside my hand
    It's a sentimental jury
    And the makings of a good plan

Posting Permissions

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