Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I have no idea how to even start!
#1
I need to figure out how write a program that replaces the vowels in user input with the splat character, *, or ASCII character 42, if you prefer.

The vowels are defined as a, e , i, o, u, and sometimes y. We will only need to replace y if it occurs at the end of a word.

The minimum requirement, that is, to receive a 60%, I have to have the program do the following:

Clear the screen

Prompt the user to enter some text

Allow the user to enter some text

After the user presses 'Enter' print what they typed back on the screen with the vowels replaced with the splat character

Make the program work dynamically. As the user types, output their keystrokes immediately, like a word processor does, replacing the vowels as you go.

If making the program work dynamically, make the backspace key work like it normally does. The program should not crash if the backspace key is presses when the cursor is in column one.

If making the program work dynamically, make the 'Enter' key work like it normally does by moving the cursor to the beginning of the next line when it is pressed.

If making the program work dynamically, and the 'Enter' key moves the cursor to the next line, make the backspace key back you up to the previous line.
Reply
#2
If you really don't have any idea how to even start, I believe you should quit the course at this time, and take it again next time it's available.  Otherwise, read on...

Most forums, including this one, welcomes persons striving to learn, including learning how to complete homework. 

However, we firmly believe that homework is given so that you may try to use concepts learned in school, so as to better understand them and be able to use them. 

For this reason, we will work with you to help you solve the obstacles you find, but, only after you have made a decent start.  This means that you should have your program sufficiently advanced to show your honest efforts.  Then, if the program doesn't work, by you having copied it here, we will be happy to give you pointers and a little shove, here and there.  But, the main effort MUST come from you!

So, it's now your turn to post here a copy of your program, as you have it so far, with your comments as to what problem or problems you are having with the code you wrote.  We will not write the code you are supposed to create for your assignment, that is up to you.

Will be looking forward to you next post, with your code and specific questions.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#3
(12-30-2007, 11:16 AM)Smurfy link Wrote:Make the program work dynamically.

Dynamically, eh? So you need to write two (2) programs, right? The first one guarantees you a 60%. The second one gets extra credit.

For the second program, the "y" at-the-end rule is interesting. You don't know until after the next character. I would take -5 points and just forget about "y".

Anyway, I suggest that you keep a string that contains everything typed so far. If the user inputs CHR$(8) (backspace) then make the string one less and clear screen and print it.

Hint: Start your second program like this:
CLS: LOCATE ,,1

That will put a cursor on the screen. Otherwise, INKEY$ does not display the cursor location like INPUT.

Mac

Hey, my chr$ 8 turned into a goofy icon. How can I turn off that kiddie stuff? I want what I type to be what you see. In fact I would like to get rid of that whole menu of faces, etc.

Never mind. I found it under "Additional Options"
Reply
#4
Thank you guys, I'll try to get a start on it and get back to you if I still need help.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)