Thread: Emergency help for the problem !!!

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    3

    Emergency help for the problem !!!

    Engineering Experiments and Function Discovery
    In engineering we often make experiments to understand how a system behaves under varying
    conditions. These experiments produce a set of data points. The next step in understanding the
    system would be to determine a formula ( ) x f y = that represents the behavior of the system.
    This process is called “function discovery”. The formula that is discovered is called to be a
    “good fit” if it goes close to the data points that are collected from the experiments.
    Suppose that we are testing the braking performance of a new car. We run different
    experiments with varying speeds and find the stopping distances of the car as:

    Speed
    (km/h)
    Stopping
    Distance (m)
    20 6.725
    40 16.625
    60 30.975
    80 50.000
    100 68.300
    120 93.125
    140 117.975

    When we plot the data, we see how the stopping distance changes with respect to speed. The
    next step is to discover a formula that goes through these data points. For instance for this
    data set, 07 . 20 9360 . 0 − = x y represents the system as shown in the figure.

    The Least Squares Approximation must be used

    PART 1:
    Write a program that reads in the data points line by line. That is, the user will give the first
    pair of x and y values, press enter, give the second pair of x and y values, press enter, and so
    on. The user will press -1 for both x and y values to stop entering data.
    Your program will find and display the two linear equations in terms of A and B (like
    equation 3 above).
    PART 2:
    Write a new program that reads in the coefficients for two linear equations of two unknowns
    and solves them. For instance when the user enters the coefficients in equation 3 as:
    56000 560 41179.5
    560 7 383.7
    Your program will find and display the values of A and B as in equation 4.
    ı hae to get the solution until this night if anybody can write the program by using stdio.h library and functions thanks

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What have you tried so far? If you have tried nothing, you will get nothing (other than posts telling you to try first). This is not a homework solution generator.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    I ain't doing homework unless I get paid.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    3
    of course iam not tryin to make to find out a solution for my homework the calculus part is the problem here anyway thanks for your guide...

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by chelp151 View Post
    of course iam not tryin to make to find out a solution for my homework the calculus part is the problem here anyway thanks for your guide...
    You said this:

    ı hae to get the solution until this night if anybody can write the program by using stdio.h library and functions thanks
    Care to reconcile these two statements? I bet you can't. I bet you'll stutter like Alberto Gonzales.

  6. #6
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    of course iam not tryin to make to find out a solution for my homework the calculus part is the problem here anyway thanks for your guide...
    umm....If you prof had wanted you only to do the calculus, not the programming, he would have given you a template, or something, that you could have at least faked to have written. But incidentally, your prof seems to thing programming actually IS something that's not so trivial, so he's telling you to write it yourself. So code away. We'll help you once you have something.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  7. #7
    Registered User
    Join Date
    Apr 2007
    Posts
    3
    i know that ii have to write this program by myself however i can not if somebody can help me i am so glad i knw lots of people can write this program without getting money but nobody understand the problem

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Write a program that reads in the data points line by line. That is, the user will give the first
    pair of x and y values, press enter, give the second pair of x and y values, press enter, and so
    on. The user will press -1 for both x and y values to stop entering data.
    This part surely can be done even if you do not understand anything else. Why haven't you done it?

    Have you searched the Web concerning "Least Squares Approximation"?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM