DOC PREVIEW
UNC-Chapel Hill COMP 004 - Turing Worksheet - Intro

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Due Date: Monday, 18 July 2005 at 1:15 PM (start of class)Purpose, and what’s comingThe above statements will display blah and then do blah blah blah…COMP 4, Summer 2005, Session II Do before Lec-13 !TURING WORKSHEET: INTRO…………………………………………………………………………………………………………………………………Due Date: Monday, 18 July 2005 at 1:15 PM (start of class)…………………………………………………………………………………………………………………………………Purpose, and what’s comingThe objective of this first Turing Worksheet (INTRO) is simply to help you to get acquainted with the Turing environment, which will allow the first Turing lecture and demos to make much better sense to you. Of course, we don’t expect you to fully comprehend what Turing is doing when it executes each program you typealthough I suspect some of it will be extremely obvious.You will be asked to type in a number of short Turing programs, provided belowone at a timethen you will tell Turing to translate (compile) that program into machine language and execute itthat entire request is done with a simple click of the Ru n button: Here, run means “Please translate this source code into machine language, and execute (do the machine cycles).”The Turing program includes both the Turing translator AND a programming environmentthe latter provides you, as a programmer, with: the Editor Window (a/ka/ Program Window) into which you will type the program (much as you would type into a word processor document’s window); a Run Window, which pops up if there is some output to be displayed; and an Error Viewer Window which tells you when there’s a syntax error (much like the way Excel pops up with an error box if you messed up a formula). Turing also provides menus (with commands).You will be given three additional worksheets after this one: labeled A, B, and C. Always work through the assigned WorksheetBEFORE you attempt to do the For Points section of each assignmentand do so by the due date. There will be nothing for you to turn in from each Worksheet; however, we will assume that you have met the objectives of each Worksheet, and the subsequent lecture/demos will pick up from there. If you are new to programming you will be lost if you skip the worksheets.The programs that you type are stored in RAM (and visible on the Program Window). Later, you will save the programs that you write; these mini programs don’t have to be saved.ATN lab PC users: Here is the path to run Turing:Start\Programs\UNC Courseware\Comp 4\Turing-4.0.2Home PC users:Our site license allows you to copy the Turing program and install it on your home PC's hard drive, but only for the durationof the COMP 4 courseafter that, you must delete it. PLEASE make note. A copy of the self-extracting archive (a compressed file that contains all the files you need to use Turing on your home computer) has been stored on the Web. The software license does not allow us to provide a direct link from our course home page to that file, so you will learn the URL during class time. At that time I will also tell you the secretlogin name and password to use (If you miss any of this send me an email.) On your home PC: Instructions on how to install the turing setup.exe program are on the web. To the uninitiated (i.e., you've never written a program): Feel free to work through this first Turing Worksheet withanother COMP 4 student, using the buddy system: one of you types in one program and runs it; then the next person types in the next program and runs it, etc. You both observe and discuss. Working side by side on all the Turing Worksheets is just fine,just as it is for the Office Workbook. Same warning holds, however: get your hands on the keyboard! Do NOT work together on the “For Points” part of any lab assignment.2General Instructions. Read through all the instructions on this page first; youwon't actually start at the computer until you see the notation Ready? on the next page. Listed below are a number of SEPARATE short Turing programs (not one big program). Each separate program is preceded by a boldfaced statement that describes something about what the program does or what we want you to observe about it. Do not type inthe boldfaced lines of text; they are for your information only. 1. You will type one program into a fresh Editor Window, correcting any errors that you make with Turing's simple editorial tools that should be very familiar to you (backspace, delete, etc); similar to any word processing program. 2. Press the Enter key only at the end of each complete statement (we’ve put each statement on each its own line). You will work with only one program at a time (explained below).3. When you finish typing a program and proofed it and corrected your typing errors, you will ask Turing to TRANSLATE and EXECUTE the program by clicking the RUN button. Any "syntax" errors will be reported by the Error Viewer Window. Fix the errors that you didn't already catch in Step 1. 4. After you fix the errors, RUN the program again. Continue to fix the errors (if any), running the program again after each correction: that's known as "Running & Debugging." Finally, when you have a clean compilation (that is, your source code has been successfully translated (compiled) into machine code, which means it has no syntax errors), your program (in object code form) will EXECUTE, and you may see some output (or not). (Of course, if you made no errors, and we didn’t provide any, you won't see the Error Viewer Window, and it will compile and run very quickly, seemingly all at once. Note that we've made some intentional syntax errors here and therebe sure you include those errors, as shown; you will be asked to correct them after you've had a chance to see what Turing does with each. This is really good practice.)5. When you have completely finished with that 1st program, close the Run Window. Erase the contents of the Editor Window by selecting all of the statements and then press the Delete key. Be sure everything was deleted! Now, type the next program, and repeat all of these steps. Then repeat for the second program, then the third, etc. etc. You do NOT have to save any of these practice program files.HOW IT WILL WORK: (keep this page handy for Worksheets A, B, & C)The


View Full Document

UNC-Chapel Hill COMP 004 - Turing Worksheet - Intro

Download Turing Worksheet - Intro
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Turing Worksheet - Intro and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Turing Worksheet - Intro 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?