![]() |
![]() ![]() |
![]() |
Exercise 1: An input routine![]() Make a program that accepts input from the user, similar to BASIC's INPUT routine. This time, you manually make the input routine yourself. The program has to be able to accept input from the keyboard and it must be contained in the string variable Inputted$. When the user presses Enter, the inputting must end with the input in Inputted$. When the user presses Backspace, the last character in Inputted$ will be deleted except when there are no more characters left. When the user presses Esc, the inputting must end and whatever that was entered will be discarded and Inputted$ will contain the Escape character. All other printable characters will be added to Inputted$. Also, the input must be echoed to the screen. (At the same location, mind you). Characters deleted must also be erased from the screen. ![]() Notes: You will use the CHR$ function or ASC function for determining the character entered and you may use either the INPUT$ or the INKEY function for the character input. Also, try not to use GOTOs but instead use DO...LOOPs. ![]() ASCII character 8: Backspace character ASCII character 27: Escape character ASCII character 13: Return character ASCII character 32 and above: Printable characters ![]() Exercise 2: Text encryption ![]() Make a program that inputs text from the user (use ordinary INPUT). Change the input so that the text is encrypted. Every letter will be substituted with the letter succeeding it in the alphabet and every digit is replaced with the digit higher than it. Z is replaced by A, and 9 is replaced by 0. All other characters will stay the same. Lettercase must be preserved. As an added challenge, you cannot use any IF...THENs, you have to use SELECT CASE with only three branches. The encrypted text will be displayed afterwards. ![]() Examples:
AaBbCcXxYyZz BbCcDdYyZzAa
9:01 pm 0:12 qn SEAV Softwares TFBW Tpguxbsft September 25, 1998 Tfqufncfs 36, 2009 ![]() Clue: You may have to use the MOD operand and the statement form of MID$ to solve this exercise. You also have to consult the ASCII functions. The program can be written in less than 15 lines of code. ![]() |
![]() |
![]()
Home Page |
Program Nook |
Instructional |
Open Forum Portfolio | Visitor's Area | Connections | About the Site ![]() Copyright © 1997-2000, SEAV Softwares. All rights reserved. Webmaster: Eugene Villar (SEAV); e-mail: evillar@iname.com |