CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2013
    Posts
    2

    C++ Question help plz

    Write a c++ program that contain the following functions :
    1) Function Quality_Point that takes one int argument (student_average) and return ‘A’ if the student_average between 90-100 and return ‘B’ if student_average between 80-89
    2) Function Distance that takes 4 double argument (x1,y1,x2,y2) calculate and return the distance between (x1,y1) – (x2,y2). All numbers and return value should be of type double
    (hint) use the following equation D= √(x1-x2)2+(y1-y2)2
    (hint) use predefine functions pow(x, y)/ sqrt(x)
    3) Function Multiply that takes three numbers and
    returns the sum of the first two numbers multiplied by the third number.
    (Assume that the three numbers are of type int.)
    Write the definition of a function main that tests each of these functions.
    Sample main
    void main()
    {
    cout<< Quality_Point (92)<<endl;
    cout << Distance(3.0,4.0,7.0,9.0)<<endl;
    cout<< Multiply(2,7,4)<<endl;
    }

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: C++ Question help plz

    Help with what? We won't write the functions for you. Please read this

    http://forums.codeguru.com/showthrea...ork-assignment

    If you have specific questions about using c++ then we'll provide guidance if you post your code.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    Join Date
    Apr 2013
    Posts
    2

    Re: C++ Question help plz

    Can u just plzz write the function and help me ,, then i will delete that that thread

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: C++ Question help plz

    Quote Originally Posted by o.m.a.r.941 View Post
    Can u just plzz write the function and help me
    Why? Isn't the goal to see if you know the material that was taught to you?

    Seriously, the questions you asked could be completed in 10 to 15 minutes, 20 minutes at the most, by any good student.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; April 30th, 2013 at 01:43 PM.

  5. #5
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: C++ Question help plz

    Quote Originally Posted by o.m.a.r.941 View Post
    Can u just plzz write the function and help me ,, then i will delete that that thread
    That would be considered cheating as this is a homework assignment.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured