Qbasicnews.com
November 14, 2019, 03:47:24 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: I have no idea how to even start!  (Read 2918 times)
Smurfy
New Member

Posts: 11


« on: December 30, 2007, 03:16:30 AM »

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.
Logged
Ralph
Ancient Guru
****
Posts: 544


« Reply #1 on: December 30, 2007, 04:39:16 PM »

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.
« Last Edit: December 30, 2007, 04:41:29 PM by Ralph » Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Mac
Senior Member
**
Posts: 243


WWW
« Reply #2 on: December 31, 2007, 06:26:05 AM »

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"
« Last Edit: December 31, 2007, 05:36:20 PM by Mac » Logged
Smurfy
New Member

Posts: 11


« Reply #3 on: December 31, 2007, 04:38:07 PM »

Thank you guys, I'll try to get a start on it and get back to you if I still need help.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!