Looking for answers to customer support questions? Click Here
Wedding Forums > Brides Helping Brides ™ > anyone know c++?
anyone know c++?
tracyg
Posted: Sep 24, 2003 10:13 AM+

Posted: Sep 24, 2003 10:13 AM
anyone know c++?
i need homework help!
smooch
Posted: Sep 24, 2003 10:29 AM+

Posted: Sep 24, 2003 10:29 AM
Re: anyone know c++?
you mean C+, the programming language? yes, i know C+. what's up?
tracyg
Posted: Sep 24, 2003 10:36 AM+

Posted: Sep 24, 2003 10:36 AM
Re: anyone know c++?
no, it's c++ we're doing.how do you compare 3 strings? i could do 2, but not 3. (in lexicographical order)
NovemberSue
Posted: Sep 24, 2003 10:47 AM+

Posted: Sep 24, 2003 10:47 AM
Re: anyone know c++?
What subject is that?
tracyg
Posted: Sep 24, 2003 10:48 AM+

Posted: Sep 24, 2003 10:48 AM
Re: anyone know c++?
computer science (algorithmic problem solving)
NovemberSue
Posted: Sep 24, 2003 10:50 AM+

Posted: Sep 24, 2003 10:50 AM
Re: anyone know c++?
Oh! Science was never one of my favorites.
smooch
Posted: Sep 24, 2003 10:54 AM+

Posted: Sep 24, 2003 10:54 AM
Re: anyone know c++?
do you need to compare all 3 at once? can you compare a,b then b,c then a,c?
tracyg
Posted: Sep 24, 2003 11:00 AM+

Posted: Sep 24, 2003 11:00 AM
Re: anyone know c++?
i tried doing all three at once but it didn't work. I think i have to compare 2 at a time, but it has to output them in order. and thats whats stumping me. I guess i compare 2 at a time and assign them values like 'first', 'second' and so on? grrrrr my head hurts. im tired of thinking!
smooch
Posted: Sep 24, 2003 11:02 AM+

Posted: Sep 24, 2003 11:02 AM
Re: anyone know c++?
are the strings in variables? how are you outputting them? are they in an array? or just outputting to the screen? are you comparing so you can sort alphabetically?
tracyg
Posted: Sep 24, 2003 11:05 AM+

Posted: Sep 24, 2003 11:05 AM
Re: anyone know c++?
yeah, comparing so we can sort it alphabetically. then output all three words in ordervariables are-
string word1;
string word2;
string word3;
smooch
Posted: Sep 24, 2003 11:21 AM+

Posted: Sep 24, 2003 11:21 AM
Re: anyone know c++?
do you use arrays yet? if so, i'd compare word1, word2. put the 'first' one in array position 0, put the 'second' in array position 1. then compare word3 with the one in the first position. if it's greater than, shift the array down 1, putting word3 in the 0th position. if it's less then, then you must compare with position 1, shift down if greater than. if less than, put in array position 2.if you are not using arrays, i'd create 3 variables: first, second, third as strings.
compare word1, word2.
if word1 > word2 then
first = word1
second = word2
else
first = word2
second = word1
...
now compare word3, putting it in the right position and moving first and second appropriately. does this help?
tracyg
Posted: Sep 24, 2003 12:27 PM+

Posted: Sep 24, 2003 12:27 PM
Re: anyone know c++?
it helps a little. thanksI have the comparing of the first two... but then once i introduce the third number it messes things up. f it, i'll just hand it in incomplete... nothing is working.
smooch
Posted: Sep 24, 2003 02:14 PM+

Posted: Sep 24, 2003 02:14 PM
Re: anyone know c++?
don't give up! give me your logic for the 3rd string. we can work through this!
tracyg
Posted: Sep 24, 2003 02:56 PM+

Posted: Sep 24, 2003 02:56 PM
Re: anyone know c++?
i ended up doing it the long way. Setting it up for each instance. then i finally got it to work when i found i was missing curly brackets in places.it bugs me i can't get it the (probably) more simpler way, but as long as i got it to work (since its due today) thats what counts.
Welcome New Vendors
- The Barn At Old Bethpage Discover the charm a...
- Tellers: An American Chophouse Celebrate Your Love ...
- Cup Of Tea Creative Unique Wedding Gifts...
- Speeches for Milestones The Big Day Has Arri...
- Long Island Bridal Expo Connecting Brides & ...
- 1 More Rep 1 More Rep: Elite Fi...
- Bellport Inn The Bellport Inn –...
- Fiddlers Dream Music Experience the Music...
- Havana Central Celebrate Your Weddi...
- Primerica Nelida Flynn Primerica Nelida Fly...
- Acetra Affairs Here at Acetra Affai...
- The Crushed Olive Discover Culinary Ex...


















