Creating a Simple Shell

Quiz (5 points)

Lets write a simple shell which displays characters as they are typed on the screen.

We previously wrote a program that can echo keys are users type them. But it is not obvious to the user that they can just start typing and keys will appear on the display. A prompt, which in our case is just the two characters '>' (greater than symbol) and ' ' (space), serves as a visual cue to the user that they can start typing. Then the computer echoes the keys that the user types, as usual.

When the user presses the "Enter" key, the computer will move to the next line and print the prompt again.

Here is an example:

> hello
>
        

The user entered "hello" and then pressed the Enter key.

The program that prints prompts and displays entered keys is called a shell.

Please use the simulator below to add, edit, or remove instructions and test your solution. You are also free to change memory cell values to aid with testing.

When you are finished, click the "Submit" button to submit and save your assignment for grading.

Time: 0
LW Computer IO Simulator
Become a subscriber to save your progress, see the correct answer, and more!

Comments

Please log in to add comments