User Profile

Collapse

Profile Sidebar

Collapse
matrim
matrim
Last Activity: Oct 26 '06, 05:45 AM
Joined: Oct 16 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • matrim
    replied to Need help using pow function in problem
    in C
    The actual formula is :

    W = 35.74 + 0.6215t - 35.75 (v0.16) + 0.4275t(v0.16)
    See more | Go to post

    Leave a comment:


  • matrim
    started a topic Need help using pow function in problem
    in C

    Need help using pow function in problem

    What I'm trying to do:

    1. Attempt to open the file. The filename, c:\\windData.tx t, should be hardcoded into your program. Note the two slash characters in the file name. If the file cannot be opened, display a message and exit the program.
    2. From the file read a temperature and a wind speed. Both values should be stored in variables declared as double. The file is a text file.
    3. Calculate the wind chill factor...
    See more | Go to post

  • matrim
    replied to How to pass parameter or call a function?
    in C
    woops. I had them there originally, then took them out for some reason. I think i messing around with using string instead of void.

    Here's what I need to accomplish:

    Your program should include

    1. A function named getData( )that gets all of the user input for a round pizza. For a round pizza it will ask for the diameter of the pizza and its price. Each piece of data entered by the user must be validated...
    See more | Go to post

    Leave a comment:


  • matrim
    replied to Need help straightening this noob code
    in C
    Thanks for that. However, we haven't even gone through pointers yet, so I need a way to do that referencing without having pointers in it? :)

    Here's what I need:

    Your program should include

    1. A function named getData( )that gets all of the user input for a round pizza. For a round pizza it will ask for the diameter of the pizza and its price. Each piece of data entered by the user must be validated...
    See more | Go to post

    Leave a comment:


  • matrim
    replied to How to pass parameter or call a function?
    in C
    Price is part of an equation, so I don't think that will work. Here's the whole file:

    Code:
    #include <iostream>
    
    using namespace std;
    
    char pizzaType;
    void getData(int length, int width, int price);
    void getData(int diameter, int price);
    double computeUnitCost(int diameter, int price);
    double computeUnitCost(int length, int width, int price);
    
    int main()
    ...
    See more | Go to post

    Leave a comment:


  • matrim
    replied to How to pass parameter or call a function?
    in C
    Hmm for some reason I put that, and I get:

    pizza.cpp
    pizza.cpp: In function `int main()':
    pizza.cpp:27: warning: unused variable 'diameter'
    pizza.cpp:29: error: `diameter' undeclared (first use this function)
    pizza.cpp:29: error: (Each undeclared identifier is reported on

    And I have:

    Code:
    int diameter;
    int price;
    getData(diameter, price);
    ...
    See more | Go to post

    Leave a comment:


  • matrim
    started a topic How to pass parameter or call a function?
    in C

    How to pass parameter or call a function?

    How do I call a function outside of main or use a parameter to pass a reference?

    If my function is:
    Code:
    void getData(int& diameter, int& price)
     { 
    cout << "Enter in the diameter of the pizza in: " << endl; 
    cin >> diameter; cout << "Enter in the the price of the pizza in: " << endl; 
    cin >> price; 
     }
    ...
    See more | Go to post

  • matrim
    replied to Need help straightening this noob code
    in C
    Thanks for the help so far! My real problem is knowing how to call and pass parameters correctly. Are the other functions right?

    Code:
    #include <iostream>
    
    using namespace std;
    
    char pizzaType;
    void getData(int length, int width, int price);
    void getData(int diamter, int price);
    double computeUnitCost(int diameter, int price);
    double computeUnitCost(int length, int width,
    ...
    See more | Go to post

    Leave a comment:


  • matrim
    started a topic Need help straightening this noob code
    in C

    Need help straightening this noob code

    I have trouble knowing how to call the function and passing parameters. Can someone help point out where things need to go? It's a basic program to figure out the cost per inch of pizza of either a round(diameter) pizza or square one.

    Code:
    using namespace std;
    
    char pizzaType;
    double getData(int length, int width, int price);
    double getData(int diamter, int price);
    double computeUnitCost(int diameter,
    ...
    See more | Go to post
No activity results to display
Show More
Working...