![]() |
Palindrome [Stupid rules]
Basically I have to write a program where the user can enter up to 30 characters and I have to check if the input is a palindrome. I did write this program and it works 100% however there is a catch... The professor wants us to store the input in char variables as in declare 30 chars and use that. What do you guys think is the least tedious way to accomplish this???
Thanks in advance. |
How are you getting the input? Scanner class? Does the professor want you to capture each char the user enters and store in a char array?
Here what I've would done :
//imports, class naming, etc...w/e! |
Yes that would be the easy way to do it.... NO arrays are allowed. I can only use a string to get the input and then I have to store each character in a char.
|
Quote:
|
Are you serious?!!? You actually have to DECLARE 30 char variables! Damn! Sorry dude... I don't have that much time. Honestly though, why would anyone need to do that!?
|
I am too... I am assuming that his goal is to make us appreciate arrays ect...
|
Yea that seems pretty stupid. My teacher in high school did something similar to get us to appreciate arrays, but there is better ways then wasting a night doing a retarded program like that lol. Just hand it in with 5 variables and add a comment at the end saying the rest will look similar haha.
|
Quote:
|
Like a monkey I just typed out around 600 lines of code and this shit ain't working. :mad:
|
I've known some very good and dedicated teachers, but there's a reason for the stereotype: Those who can, do; those who can't, teach.
|
| All times are GMT -5. The time now is 9:33 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC