Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,243 members, 7,953,916 topics. Date: Friday, 20 September 2024 at 08:52 AM |
Nairaland Forum / Science/Technology / Programming / Programming Challenge 1 (any Language). (1448 Views)
Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) / . / Coding Challenge 1: Permutations (2) (3) (4)
Programming Challenge 1 (any Language). by kodewrita(m): 8:31am On Aug 08, 2013 |
Write a program, in any free language, that prints to the terminal the lyrics to this song, 99 Bottles of Beer)(http://99-bottles-of-beer.net/lyrics.html). If you copy anything from that site, it will be obvious, so don't try it, although you may find that site useful for seeing code of many different languages. Rules: Do not copy code, but you can obviously read it Try not to comment on other submissions. It will be hard to judge changing entries. If you edit your code, post the new version and make it clear there is a new code. How it will be judged Obviously, this is a task that is trivial (one big output statement would work) so the winner will be judged on the following: •Clean code. Readable code is a must for being a programmer who wishes to possibly interact with others. Some languages can be more readable than others, so it will be judged on the effort of writing clean code, not which language is easier to read by design. •Logical code. Be a programmer, not a code monkey •Commented code. If something is possibly unclear (like an obscure use of math), let the readers know. Do not over comment, and let the code speak for itself whenever you can. Have logical variable names and function names. (Excessive commenting is a minus factor) •Working code. It has to work as it is posted. The code will be read on the forum Hints: •When you get to 1 bottle, it is a singular "bottle", whereas all other instances are plural. •Using this challenge to try out a new language brings you bonus points, so please state when you are using the language for the first time if you are. All the best. |
Re: Programming Challenge 1 (any Language). by spikesC(m): 9:47am On Aug 08, 2013 |
Re: Programming Challenge 1 (any Language). by Javanian: 10:01am On Aug 08, 2013 |
Re: Programming Challenge 1 (any Language). by Ajibel(m): 12:20pm On Aug 08, 2013 |
Kodewrita: i've studied this challenge when i saw it as an exercise in the book "Think python". And i read the author's solution to it, should i post my solution and claim to have solved it i know am naa noni |
Re: Programming Challenge 1 (any Language). by spikesC(m): 12:38pm On Aug 08, 2013 |
Ajibel: Kodewrita: No, solve it in your own way I will personally look up ur solution with the book's...thanks for giving the name, makes the job easier |
Re: Programming Challenge 1 (any Language). by kodewrita(m): 1:51pm On Aug 08, 2013 |
Ajibel: Kodewrita:Some people we shall kidnap..... |
Re: Programming Challenge 1 (any Language). by Ajibel(m): 2:48pm On Aug 08, 2013 |
kodewrita: peapul Like Spikes c |
Re: Programming Challenge 1 (any Language). by spikesC(m): 3:07pm On Aug 08, 2013 |
Re: Programming Challenge 1 (any Language). by elvis10ten(m): 7:27am On Aug 10, 2013 |
@javanian, why use pastebin when you can use ideone.com . Its more better. *winks* |
Re: Programming Challenge 1 (any Language). by elvis10ten(m): 7:28am On Aug 10, 2013 |
Here is my solution. http://ideone.com/iceAYA . @kodewrita, what of that stuff na ? |
Re: Programming Challenge 1 (any Language). by DharkPoet(m): 6:12pm On Aug 10, 2013 |
Here's mine, done in java, I'm a beginner in programming, hence java is my first language. Here's my solution again http://ideone.com/ji8Ysj |
Re: Programming Challenge 1 (any Language). by elvis10ten(m): 11:56am On Aug 11, 2013 |
My new solution: http://ideone.com/u3zwJa |
Re: Programming Challenge 1 (any Language). by codeaddict(m): 8:58am On Aug 12, 2013 |
Javanian: So much talk about recursion on this board recently, so i used itNice approach! One error though. Lines 19-23 will print out the wrong result when n is 2. "1 bottles of beer on the wall". |
Re: Programming Challenge 1 (any Language). by Nobody: 4:54pm On Aug 15, 2013 |
lemme try, C# for (int i = 99; i >= 0; i--) { if (i != 1 && i !=0 && i != 2) { lblResult.Text += i + " bottles of beer on the wall, " + i + " bottles of beer.<br />" + " Take one down and pass it around, " + (i - 1).ToString() + " bottles of beer on the wall." + "<p></p>"; } else if (i == 2) { lblResult.Text += i + " bottles of beer on the wall, " + i + " bottles of beer.<br />" + " Take one down and pass it around, " + (i - 1).ToString() + " bottle of beer on the wall." + "<p></p>"; } else if (i == 1) { lblResult.Text += i + " bottle of beer on the wall, " + i + " bottle of beer.<br />" + " Take one down and pass it around, no more bottles of beer on the wall." + "<p></p>"; } else if (i == 0) { lblResult.Text += "No more bottles of beer on the wall, no more bottles of beer.<br />" + "Go to the store and buy some more, 99 bottles of beer on the wall."; } } |
(1) (Reply)
Simplex Media Converter download link available ! / Help Solve My Android Sdk Manager Challenges / C++ Programming: To Do Or Not To Do.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 18 |