Show Bid Request
C++ program and question
Bid Request Id: 7800
|
|
|
Posted by: |
RM1969 (2 ratings)
(Software buyer rating 10)
|
Non-action Ratio: |
Very Good - 25%
|
Posted: |
Jan 20, 2002 2:16:58 PM EDT
|
Bidding Closes: |
Jan 22, 2002 2:19:27 PM EDT
|
Viewed (by coders): |
301 times
|
|
|
|
Description:
The program:
Write a program that adds the positive odd numbers you enter from the keyboard while ignoring the even numbers, and stops when a negative number or zero are entered.
Display the sum of the accepted odd numbers.
The question:
1. Write a while loop equivalent to the following:
Int a = 4;
While (a > 0 )
{ cout << a << " " ;
a -= 1;
}
without the last line of the loop. Use an increment/decrement operator inside the while condition and any other changes to any of the lines listed above in order to make sure the program's behavior will no change. In other words, the loop body should only contain the line cout << a << " ".
The loop should look as follows:
Int a = ? ;
While ( ? > 0 )
cout << a << " ";
where you will replace the ? with the proper code so that the output of this code is the same as the original output.
1. Again, write another equivalent loop, but this time use an increment/decrement operator only on the
Loop body.
While ( a > 0 )
Cout << a << " " ;
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
Special Conditions / Other:
Before january 22/2002
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$4 (USD)
|
Jan 20, 2002 2:40:07 PM EDT
|
10
(Excellent)
|
|
|
That's no problem. I'm not interested in the money at the moment - I'm just trying to get my first rating. |
|
|
|
|
|