Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Wood Food Processor! DESPRIT!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dietz1988




PostPosted: Fri Apr 08, 2005 12:36 pm   Post subject: Wood Food Processor! DESPRIT!!

hey... and yes, I'eve got a grade 12 turing class and im stumped on this assignment..

Now to some information about the assignement..
I need to make a program that will do the following: (this is the exact assignment sheet ) ....

Write a program that will ask the user for a sentence. After the user has typed in their sentence, they will be asked if they want to do one of a number of things with it:

- display the sentence in reverse order
- display only the vowels (y is a consonant)
- display only the consonants
- count the number of times a certain
character occurs

Hint: One possible structure for this program is putting an if..then structure inside a loop.

Hint for options 2 and 3: You need a string that has all the vowels, and a string that has all the consonants. Search those strings for the characters in the sentence one by one.

Hint for option 4: Go through the sentence one character at a time looking for the letter the user enters.

Keep in mind that you are always working with the same sentence until the user decides to enter a new sentence.

------------------------------------------------------------------------

SAMPLE RUN
Enter a sentence.
The Leafs will win the Stanley Cup.

Choose an option:
1 - display sentence in reverse order
2 - display only the vowels
3 - display only the consonants
4 - character count
5 - enter a new sentence
6 - quit

1
[clear the screen in between]

.puC yelnatS eht niw lliw sfeaL ehT

Choose an option:
1 - display sentence in reverse order
2 - display only the vowels
3 - display only the consonants
4 - character count
5 - enter a new sentence
6 - quit

2

eeaiieaeu

Choose an option:
1 - display sentence in reverse order
2 - display only the vowels
3 - display only the consonants
4 - character count
5 - enter a new sentence
6 - quit

4

Which character? e

There are 4 occurences of that letter.

------------------------------------------------------------------

If i could get some help with this I would REALLY appreciate it.. Post here or hit me up on MSN or AIM :
MSN - Snakebyte720@hotmail.com
AIM - Snakebyte404

---------------

p.s - ieve got the basics down but im stuck on some of the more complicated things like displaying the given sentence backwords, and displaying the vowels and the consonants.. I can do the character count but otehr than that im stumped.. Appreciate your help.
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Fri Apr 08, 2005 1:58 pm   Post subject: (No subject)

[mod:e2c787606b="AsianSensation"]Code taken off for stated reasons below[/mod:e2c787606b]

And another computer science student gets away with a freebie. meh.
Dietz1988




PostPosted: Fri Apr 08, 2005 2:09 pm   Post subject: (No subject)

niceee man.. you saved the day!

looking at that code it makes sense now.. its kinda like math.. once they show u how to do it yoiu can do it on ur own.. hehe.. thanks a bunch
jamonathin




PostPosted: Fri Apr 08, 2005 2:22 pm   Post subject: (No subject)

Yeah no probs man.
AsianSensation




PostPosted: Sat Apr 09, 2005 5:31 pm   Post subject: (No subject)

Oi. jamonathin, you just broke one of the most sacred rules of compsci.ca.

See, this website is designed to help students, kind of like a tutoring service, except it's all volunteery. We don't just hand out homework assignment answers to everyone that asks. No cheating allowed was one of the first rules ever implemented.

Consider yourself warned. You can help him step by step, but don't tell him the answer and do his homework for him. Yes, I know it takes longer, but helping others to cheat is violating compsci.ca's purpose.

I am going to edit the post so other students from his school doesn't copy off the same code.
jamonathin




PostPosted: Sat Apr 09, 2005 8:19 pm   Post subject: (No subject)

shizah! I'm sorry man, won't happen again. Embarassed
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: