3 Replies - 1018 Views - Last Post: 25 January 2010 - 01:12 PM Rate Topic: -----

#1 deg01   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-January 10

Help for a Program in C++

Post icon  Posted 23 January 2010 - 04:12 PM

Hi, I need some help with a problem I was given for homework in programming class. Here it is:
You have to write a program in C++ that computes the difference between the maximal and the minimal 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 the minimal or maximal values do not exists, your program should output appropriate messages.
Please, send the source code of your program together with the calculated integer values of x and y for which f(x,y) reaches its minimum and maximum on [a, b] x [c, d].
I don't understand what exactly the program should do, also some hints on how to write it would be greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Help for a Program in C++

#2 Splatocaster   User is offline

  • D.I.C Head
  • member icon

Reputation: 51
  • View blog
  • Posts: 182
  • Joined: 22-December 09

Re: Help for a Program in C++

Posted 23 January 2010 - 06:10 PM

READ THIS FIRST:

1. We will not do your homework for you! Do not ask us to give you code!

First two rules. Broken.

Make a program that will ask the user for 2 floats. Than use condition operators in an if statement to make sure both floats are less than 100 and greater than -100. Make a function with 2 parameters, a and b. In that function have it figure out which is less.
Was This Post Helpful? 0
  • +
  • -

#3 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Help for a Program in C++

Posted 23 January 2010 - 06:19 PM

So what kind of class is this for. A Programming class or a numerical analysis class?

I would imagine a numerical analysis class in which case you should look at a Numerical differentiation. I would imagine that you class has covered a few of these and you should probably look at the methods you covered in class.

The basic process will be easy though the details of the calculation will probably use matrices and may be a bit tedious.

@Splatocaster -- I don't think the poster violated the rules -- I don't see a request for the code, just someone asking for some direction and advice on how to proceed.

Please read over a post before you jump to conclusions.

(and remeber that it is the moderator's job to moderate).


That being said: @deg01 -- Splatocaster's is correct in saying that we will not write your code for you so don't ask.
Was This Post Helpful? 0
  • +
  • -

#4 Splatocaster   User is offline

  • D.I.C Head
  • member icon

Reputation: 51
  • View blog
  • Posts: 182
  • Joined: 22-December 09

Re: Help for a Program in C++

Posted 25 January 2010 - 01:12 PM

@nick - haha ya agreed, sorry about that...bit too eager to be active
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1