473,486 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Any Sample???

JT
Write a program that read a line of text, changes each uppercase letter
to lowercase and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome
Output:

Please enter a line of text
I am A.I
i AM a.i

This is a palindrome

Oct 7 '05 #1
4 3310
JT wrote:
Write a program that read a line of text, changes each uppercase letter
to lowercase and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome
Output:

Please enter a line of text
I am A.I
i AM a.i

This is a palindrome


See http://www.parashift.com/c++-faq-lit...t.html#faq-5.2

Cheers! --M

Oct 7 '05 #2
"JT" <ja*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Write a program that read a line of text, changes each uppercase letter
to lowercase and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome
Output:

Please enter a line of text
I am A.I
i AM a.i

This is a palindrome


Show us (the exact code of) what you've tried, explain specifically what
problems you're having, and you'll get plenty of help with this.

Nobody here will do it for you.

-Mike
Oct 7 '05 #3
"JT" <ja*****@gmail.com> wrote:
Write a program that read a line of text, changes each uppercase letter
to lowercase and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome
Output:

Please enter a line of text
I am A.I
i AM a.i

This is a palindrome


But it is not a result of running the program you were asked to write. The
program you write will not produce any upper case letters. The exercise is
such that if you start writing you will not run into any blind alleys and
have to discard a significant amount of work. So start writing and when you
get stuck, *then* post a question.

If you require the user to type only letters as input, it will be easier and
get you started in a more painless fashion. Get clarification as to what is
expected in the punctuation area, and change what you have later on, if
necessary. The decimal point in your sample looks like magic, not a
computer program.

Oct 7 '05 #4
"JT" <ja*****@gmail.com> wrote:
Write a program that read a line of text, changes each uppercase letter
to lowercase and places each letter both in a queue and onto a stack.
The program should then verify whether the line of text is a palindrome
Output:

Please enter a line of text
I am A.I
i AM a.i

This is a palindrome

osmium <r1********@comcast.net> wrote: But it is not a result of running the program you were asked to write. The
program you write will not produce any upper case letters.
Looking back at it, it seems that instead of checking whether or not the
text is a palindrome, the example that he gave just toggles the case
(i.e., upper case or lower case) of each letter.
If you require the user to type only letters as input, it will be easier and
get you started in a more painless fashion. Get clarification as to what is
expected in the punctuation area, and change what you have later on, if
necessary.
I agree, he will need to find out whether punctuation should be included
or not. Most of the times that I have seen people refer to palindromes,
they only consider the order of the letters, and not the spacing or
punctuation, but his requirements may be different. However, based on
(my) common convention, it would indeed be a palindrome, but it would
not be one if punctuation/spacing is significant.
The decimal point in your sample looks like magic, not a
computer program.


See my first sentence.
To JT,
Please double-check your definition of "palindrome".

--
Marcus Kwok
Oct 7 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2015
by: Alexandre | last post by:
Hi, Im a newb to dev and python... my first sefl assigned mission was to read a pickled file containing a list with DB like data and convert this to MySQL... So i wrote my first module which...
0
2000
by: Ravindra | last post by:
Well I installed the framework provided by microsoft , the problem is I am able to activate the smart tag in the doc file but when I Click on the Show Detils option in the information bridge the...
5
7928
by: Ale | last post by:
Ciao a tutti. Ho eliminato il database di esempio SAMPLE(non cancellato). Ora lo voglio reinstallare ma durante l'installazione mi da il seguente errore: nella finestra con scritto SQL1005N c'è...
6
3132
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something...
1
2484
by: Eliezer Figueroa | last post by:
Full Database System Sample? I want to know if there any good windows forms based database sample application that can be downloaded.I searched the MS site but most of the database samples are...
0
1644
by: Ray Tayek | last post by:
hi, getting a: .\Stdafx.cpp : fatal error C1192: #using failed on 'i: nunit\samples\cpp-sample"' 'The filename, directory name, or volume label syntax is incorrect.' nunit is installed in...
6
13186
by: zhif | last post by:
I installed IBM DB2 Database for Window (Ver. 9) before. Meanwhile, I installed the database SAMPLE. Because I forgot my password, I uninstalled later on. Several days ago, I reinstalled again....
5
16108
by: Otto Wyss | last post by:
I've now been looking for a week for a simple but useful sample on how to get a list of entries (persons) via an XMLHttpRequest using Json/PHP on the server. So far I've found about a thousend...
69
5514
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
36
4485
by: puzzlecracker | last post by:
Would someone explain why this declaration is illegal: class Sample<T> where T : Stream, class
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.