C++ program that prompts the user to enter three different positive iteger values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • haelly
    New Member
    • Oct 2007
    • 2

    C++ program that prompts the user to enter three different positive iteger values

    Write a program that prompts the user to enter three different integer values.If the values are not different, the program prints a message"equal values" and terminates(hint : use the return statement).If either of the values is negative,the progra prints"Negative input" and terminates.Othe rwie, it prints the values that the user enters.
    After that, the program compares the first integer and the second ineger and prints either "The first integer is larger than the second" or "The second integer is lager than the first".Then it compares the second integer and the third integer and prints either "The second integer is larger than the third" or "The third integer is larger than the second".
    On seperate lines, the program should print the minium value, the maximum value,total of the input values,their average and their product.Make sure you know what happens wen input data exceed the legal range for integers.Make sure that these results are correct even when the input values are close to the legal limits for integers(hint: convert input values to the values of type double).Fr example, if the user enters 1000000, 2000000, 3000000, the dialog looks this way:
    Please enter three different psitive integer values:1000000, 2000000,3000000
    The second integer is larger than the first
    The third integer is larger than the second
    The minimum value is 1000000
    The maximum value is 3000000
    The average value is 2e+006
    The product is 6e+018

    Defne variables that contains the results of computations as close to their use as possible,no at the start of main(). Test the program so that each statement of te program was executed at least once.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Where are you stuck on this? What have you tried?

    Comment

    • william johnson
      New Member
      • Oct 2007
      • 1

      #3
      Originally posted by sicarie
      Where are you stuck on this? What have you tried?
      im stuck on the body

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

        Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

        Then when you are ready post a new question in this thread.

        Comment

        Working...