• 0

Homework help C++


Question

Hey Guys i was wondering if anyone could lend me a hand for my homework. I really haven't got a clue.

"You have to write a program in C++ that computes the minimal and the maximal value of function f(x,y) obtained on an integer point in a given rectangle [a, b] x [c, d]. Your program should prompt the user to input numerical values of a, b, c and d, as floating point numbers, which are expected to be in a range from -100 thru 100. In case when minimal or maximal values do not exists, your program should output appropriate messages.

a=7, b=10, c=-5, d=10, f(x,y)=(1+x)*(1-y);"

That's my task.Please keep it simple, and thx a lot for the help.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Pseudo code my friend...pseudo code. You gotta start off by understanding what the program is suppose to do. What's the data that the program has to process. What goes in, what come's out, etc. Then write it in English (pseudo code). Once your pseudo code is done, transferring it into code is easy.

We will try and guide you down the right path, but having us do your homework for you is not gonna make you into a better programmer.

Link to comment
Share on other sites

  • 0

im absolutly rubbish at C++ as i have just started :D and my spelling is rubbish as i started it only 17 years ago... but any way...

im trying to guess what the hell you want buttttt first u could always work out the possbile maths equation for your self is simple alergbra which is as said simple enough you set a b c d as varibles from the output of the cin, but you use and set that as the new varible (depending on which one they typed there you have your user in putt :/ im not going to write it as i can just about say this... then you just need to simply write the maths equation in using the varibles as a cout make sure you set them as intergers (excuses my spelling) ... people please correct me if im wrong or even add to it if im right .. but i belive thats it ;)

Link to comment
Share on other sites

  • 0
Hey Guys i was wondering if anyone could lend me a hand for my homework. I really haven't got a clue.

"You have to write a program in C++ that computes the minimal and the maximal value of function f(x,y) obtained on an integer point in a given rectangle [a, b] x [c, d]. Your program should prompt the user to input numerical values of a, b, c and d, as floating point numbers, which are expected to be in a range from -100 thru 100. In case when minimal or maximal values do not exists, your program should output appropriate messages.

a=7, b=10, c=-5, d=10, f(x,y)=(1+x)*(1-y);"

That's my task.Please keep it simple, and thx a lot for the help.

I don't believe you haven't got a clue. Know how to work with C++ (Visual Studio, your compiler, whatever) ? Know how to print messages with cout ? Know how to query the user for input and store the inputs in variables ? Have any idea how you could find the maximum or minimum of a function over a certain range ?

Give us a sample of what you have tried and be more precise in your questions, and you'll get more useful answers. :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.