Campbell Ritchie wrote:For repetition until somebody writes "stop" try this old thread and see if you can get it faster than Robin did.
bue curt wrote:
I'm not even sure of this codes are close enough to attain that goal.
Can you point out my errors? What should I change? Am I getting there?
Does it compile? And if it doesn't what is the error?
Does it run? And if it does, what happens?
Generally, the easiest way to find an error is to figure out what is wrong first.
Henry
bue curt wrote:
Ashish Schottky wrote:Can you provide me with an example of the output.
e.g. 1500 can be 'Fifteen Hundred' or One Thousand Five Hundered.
So if you give me the desired out put may be I can help you.
Or you could just create a 1000 element array and fill it with all the answers.
David Newton wrote:@Harold: Please be very careful when providing complete or even partial solutions. One of our goals here is to get people to do all of their own work, experience their own triumphs and failures, learn how to learn, and so on. I'm leaving your code (someone else may not), but it's on the edge of what I'd consider "too much information". (I'm also a bit more draconian about this than some here.)
As far as I can remember, it was simply a while loop . . . once Robin got her act together to read the thread.bue curt wrote: . . .
We are not allowed to use that code.
Switch,if,if else,while,do while,for loop are the only allowed method.
Misha van Tol wrote:If you're allowed to use array's you don't need the switch / case structure. And no, I don't mean one array of a thousand items. Three array's of nine items should be enough.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:Sometimes, assignments are given to get the student to learn how to use certain features, like case statements, or for loops, or certain data structures. By limiting what they are allowed to use, the instructor can better show the strength and weaknesses of various data types or control structures.
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|