![]() |
|
#1
|
|||
|
|||
parody: elp neededcan someone elp me pleease.
i hav this hollowing code and dunno what it does or what it shout do. CPP / C++ / C Code:
pleease elp |
|||
|
#2
|
|||
|
|||
|
Quote:
Two questions here: 1. What does it do? Answer: It does what it does. 2. What should it do? Answer: Well, what "should" any of us do? Programs don't really know what they "should" do; they only do what the Programmer tells them to do. (So, I claim, we can't just look at a program and tell what it "should" do.) One problem with compiling this program (if it is a program) with standard C++ compilers: namespace std is not specified, so cin, cout, and endl would not be recognized. (Unless the Programmer intended some other namespace, in which he could have defined cin, cout, and endl to do pretty much anything, he wanted, including formatting the hard disk of the machine running the program. In any case, the namespace should have been specified.) By the way, regardless of what the program "should" do, there is a bug: the automatic array variable ca4ngjse548eb5f[] is not initialized, but values indexed by 2-9 are printed out. (The program also doesn't handle non-numeric inputs very well, since it goes into an infinite loop, but maybe that's not a bug --- maybe it's a "security feature".) If I wanted to guess what it "should" do: This Programmer might have wanted it to do something like this: Get numeric input values from a user console (maybe this is the amount of a sale or something). Continue getting values until the user enters -1. For each user input value, calculate a transaction fee (maybe a commission): 200 dollars plus 9% of the transaction amount. Limit the fee to values greater than or equal to 200 and less than 1000. Keep track of the number of fees between 200 and 299, 300 and 399, etc., in an array and print them out. Regards, Dave |
|
#3
|
|||
|
|||
|
thx Dave soo much. Now this little butiful butiful 2 line program...
CPP / C++ / C Code:
programming is worderful. love you all. |
|
#4
|
|||
|
|||
|
Quote:
Maybe someone can translate the remaining text from Bahasa or whatever. Since that's what the user sees, it could give a clue as to what the program is "supposed" to do. Whitespace + consistent indentation can improve readability of program structure, but non-programming language semantics still come into play. What else do you need? CPP / C++ / C Code:
Regards, Dave |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Seeking 3rd party online processing system for Ukraine | workoholic | eCommerce / Merchant Account Forum | 11 | 06-Jul-2005 07:58 |
| Small Help Needed | p_kumar81 | C++ Forum | 35 | 09-Nov-2004 10:03 |
| Free 1st month / Free setup / No credit card needed...Plans start at 4.95 | LarryIsaac | Web Hosting Advertisements & Offers | 0 | 11-Oct-2003 14:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The