GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Sep-2008, 20:54
shadowKnight shadowKnight is offline
New Member
 
Join Date: Sep 2008
Posts: 1
shadowKnight is on a distinguished road

Evaluating a class as a linked list and checking for postfix expressions


Here's the problem:

I need to create a class "String" that is implemented as a linked list. This class should include the following string operations:
• String input and output
• A function which returns the string length
• A function which returns the nth character, where the first character is number 1
• Overloaded operators = (assignment), ==, !=, <, >, <= and >= (relational).

I then need to write a class "N" as a subclass of class "String". This class "N" should include an isPostfix Boolean function which determines whether or not a String is a postfix expression, where the operands of the expression are a single lowercase letter, and the operator is +, -, * or /. I will not have to evaluate any postfix expressions.

Does anyone know how do do this or has done this before? Any help would be greatly appreciated. thanks.
  #2  
Old 25-Sep-2008, 21:08
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: evaluating a class as a linked list and checking for postfix expressions


Quote:
Originally Posted by shadowKnight
Does anyone know how do do this or has done this before?
What you describe is simply a standard linked list structure wrapped with various C++ amenities. My recommendation is to:
  • first write code to implement a linked list.
  • coming up with the string's length should be obvious -- count while traversing the list.
  • finding the nth character is just a variation on this same theme.
  • adding operator overloading functionality is yet another variation still.
If you run into trouble, post code (with [cpp before, & [/cpp] afterwards...) & ask specific questions.
  #3  
Old 25-Sep-2008, 23:12
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: evaluating a class as a linked list and checking for postfix expressions


Quote:
Originally Posted by ocicat
If you run into trouble, post code (with [cpp before, & [/cpp] afterwards...) & ask specific questions.
Make that [cpp] before, & [/cpp] afterwards.
  #4  
Old 25-Sep-2008, 23:19
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 841
admin will become famous soon enough

Re: evaluating a class as a linked list and checking for postfix expressions


ocicat,

Thank you for suggesting the correct tags (to use). You may want to use the NOPARSE tag yourself e.g.:


Make that [cpp] before, & [/cpp] afterwards.


You can review how I posted that by clicking on the "Reply With Quote" button of this post... I think
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Link List In C Peter_APIIT C Programming Language 33 12-Jun-2008 14:33
Str_Misaligned in Double Link List Peter_APIIT C Programming Language 1 29-Feb-2008 21:50
Doubly linked list KK2202 C++ Forum 2 13-Feb-2008 22:49
yet another linked list program aijazbaig1 C Programming Language 15 11-Sep-2007 14:18
Help in C Print is not working with LinkList batman3280 C Programming Language 3 09-Mar-2006 20:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:10.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.