Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Please help me do the sourcecode for these program using..!!!thanks!!!

Please help me do the sourcecode for these program using logical statements or if or switch!!!thanks!!!
1. Create a program that will derive two positive integers based on two inputted results. The program will accept two positive integers (input1 and input2) which are either the sum, product or difference of another 2 integers ( operand1 and operand2).

The operand's value is always a positive integer and must not exceed 100 otherwise it should print invalid input. The program should contain the given examples's format on how to derive and present the solution.

Please select the results to derive the base numbers:
1. sum-difference
2. product-sum
3. difference-product
Enter choice:



Comments

  • bilderbikkelbilderbikkel Member Posts: 754
    [b][red]This message was edited by bilderbikkel at 2005-9-17 1:54:13[/red][/b][hr]
    First:
    This message should be posted in the C++ Message Board, as this is 'just' C++. C++ Builder questions are about TStringList, TForm, imaging, etc. Pure math can be done in C++.

    Second:
    Have you read to posting rules? If no, read it and re-evaluate the title of you post.

    Third, the answer ;-) :

    : Please select the results to derive the base numbers:
    : 1. sum-difference
    : 2. product-sum
    : 3. difference-product
    : Enter choice:
    The flexibility to use different functions on the same two inputted values is given by the Strategy Design Pattern (See the C++ glossary).

    To return two values as return value, you can use:
    - a std::pair (see C++ glossary)
    - referencing (see C++ glossary)

    This should get you on the road!
  • biggdeebiggdee Member Posts: 7
    : Please help me do the sourcecode for these program using logical statements or if or switch!!!thanks!!!
    : 1. Create a program that will derive two positive integers based on two inputted results. The program will accept two positive integers (input1 and input2) which are either the sum, product or difference of another 2 integers ( operand1 and operand2).
    :
    : The operand's value is always a positive integer and must not exceed 100 otherwise it should print invalid input. The program should contain the given examples's format on how to derive and present the solution.
    :
    : Please select the results to derive the base numbers:
    : 1. sum-difference
    : 2. product-sum
    : 3. difference-product
    : Enter choice:
    :
    :
    :
    :

Sign In or Register to comment.