For each exercise, you must also have a main program to test your procedure.
- Write a procedure called printMyName, which will print your name. You may want to format the output to centre your name on the line. (Turing Solution)
- Write a procedure called printMyAddress, which will print your address. You may want to format the output to centre your name on the line. (Turing Solution)
- Write a procedure called printMySignature, which will print your name and address inside a box made up of characters. You should use the previous two procedures as part of this program. The output might look something like: (Turing Solution)
********************
Your Name
Your Address
********************
- Write a procedure called checkMyName, which will keep asking for YOUR name (looping). When you give your name, the procedure will exit and return control to the main program. (Turing Solution)
- Write a procedure called countDown10, which will count backwards from 10 to 0, with a 1 second delay between displaying each number on the screen. (Turing Solution)
- (a) Write a procedure which asks the user to enter a number (integer), and then print out the '@' character that many times on a single line.
(b) Modify the procedure so it asks for both a number and the character to print out.
Comments (0)
You don't have permission to comment on this page.