473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

2
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.Otherwie, 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.
Oct 3 '07 #1
3 3630
sicarie
4,677 Expert Mod 4TB
Where are you stuck on this? What have you tried?
Oct 3 '07 #2
Where are you stuck on this? What have you tried?
im stuck on the body
Oct 23 '07 #3
sicarie
4,677 Expert Mod 4TB
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.
Oct 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jmac | last post by:
Greetings fellow programmers, I have created a C program that has a few bugs and would like to get some help with working them out. Here is a list of the problems that I am experiencing: -...
6
by: tigrfire | last post by:
I've been working on a program to try and play a game of Craps, based on a version I found elsewhere - I didn't code the original, but I added a few things such as a balance and wager system. I'm...
1
by: sunnyhanda | last post by:
Write a program that will generate, but not display, a three-digit "target" number that has three distinct digits. Then, inputs a maximum of eight user guesses and, for each guess, outputs the number...
1
by: recioss | last post by:
CODE] represent a time amount measured in hours, minutes, and seconds and then prints the equivalent time in seconds. Use three lines for input and one linf for output. The user's responsers should...
10
by: ycg0771 | last post by:
I'm trying to modify the following program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the...
0
by: south622 | last post by:
I'm taking a beginning Java course and I'm stuck in week eight of a nine week course. If anyone could help me I would greatly appreciate it. This assignment was due yesterday and each day I go past...
6
by: aureao4 | last post by:
I'm new to Java and programming. I'm trying to code a payroll program and continue getting errors. The program worked last week, this week I have to add set, get and a class. I've written the class...
1
by: haelly | last post by:
write a program that prompts the user to enter three different positive integer values.If the values are not different, the program prints a message"equal value" and terminates(hint:use the return...
1
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.