Unformatted text preview:

COMP 4, Summer 2005 – Session IILab-08A: Intro to ProgrammingTotal Points Possible: 10Due Date: Tuesday, 19 July 2005 at 1:15 PM (start of class)TURN INCOMP 4, Summer 2005 – Session IILab-08A: Intro to Programming………………………………………………………………………………………………………Total Points Possible: 10Due Date: Tuesday, 19 July 2005 at 1:15 PM (start of class)………………………………………………………………………………………………………After attending class and completing this assignment, you should be familiar with basic programming. In detail, you should know the following fundamental concepts. (Read L to R)put command Variable declarations Arithmetic expressions get commandInteger, real, string data types Editor Window Run Window Error Viewer WindowComments (%)NOTE: All programs must be written in the Turing Programming Language; please use Turing 4.0.2.PICK UP HANDOUTS- Turing Worksheet APROGRAMS NEEDED- Turing 4.0.2. (refer back to Turing Worksheet INTRO for all details!)ATTENTION- For All Turing Assignments: Do not use any commands other than those provided on the Keywords summary.- Although the Lab is due on Tuesday, start early and try to finish it by Monday. This will give you ample time for completing Lab08B by Wednesday!………………………………………………………………………………………………………………………………SECTION I: LEARN & PRACTICE: Sample Programs………………………………………………………………………………………………………………………………A. Getting Familiar: 1. Complete Worksheet A first. (You should have already completed the Worksheet Intro.)Look carefully at the sample programs that produced errors, or no output. Be sure to understand why they have caused an error, or unexpected (or no) output. If the operation of put , get , %, cls , or var is still unclear after you have completedthis Turing Worksheet, then see your instructor before proceeding with the FOR POINTS section.………………………………………………………………………………………………………………………………SECTION II: An easy “Hello” Program (FOR POINTS)………………………………………………………………………………………………………………………………CRITICAL INFO1. SAVING Turing programs you write. Save your program often (the active print window should default to the Editor Window). For this assignment, name your program: Lab08A-Hello.t Note! Use the correct file name extensionthe telse it may not be recognized by the Windows OS later.(To make all filename extensions visible, open My Computer, View/Options/View Tab, then de-select the "Hide file extensions for known file types" option.)2. OPENING any Turing program files. You can open each Turing program file from within the Turing application (simply double-click on its icon may or may NOT work): Launch Turing first, then use the File/Open feature and select the filename. Also, make sure the Turing files you save aren't nested too deeply in subdirectories that have long names-it appears that the full path name (file specification) cannot be longer than 256 characters (Turing would display a "Get FileNameForOpen Error 12291" message. It is unlikely that your path name would be that long, but anything's possible).3. You need to master only the concepts taught in the 1st Turing lecture and in Worksheet A (and Intro) to complete this assignment (and Lab-08B). Concepts you will learn in subsequent Turing lectures (and in Worksheets B & C) are required to complete only Lab-09.What’s coming…You want to improve morale at your company by greeting each employee when they enter the company. Unfortunately, you have many employees now, including several who work from other offices. You decide that having a computer greet them when they arrive would be the best strategy. Being the shrewd businessperson you are, you want to learn to do this yourself to cut costs.PURPOSE, and DESIRED OUTPUTPURPOSE, and DESIRED OUTPUTYou will design, write, and test a Turing program, which deals with simple input and output instructions. The specifications are described within Minimum Requirements, below.MINIMUM REQUIREMENTS:A. DESIRED OUTPUT:Refer to the sample output (on the web) for an example of what your output might look like. Your completed program must print “Welcome to the Happy Login Service!”, then a greeting statement based on a user’s input. (Output specifications are provided below.)B. USER INPUT:You should anticipate that the person who runs your program knows nothing about programming. He or she doesn't understand programmer jargon (like program, variable, input, and data). Pretend that he or she will run your program without ever seeing any of your actual program code (just as you do when you run Word or Excel). For example, imagine that he or she can find the <ENTER> key on the keyboard, but may not know they have to press it after data entry. Remember, comment statements in the program are for programmers' eyes only (do you, as a user, see the comments made by Microsoft’s programmers in their code? Doyou ever see their source code?). The user must be informed of what the program will do for him or her, and instruct the user (via screen prompts) on what to do and how. Make sure the screen prompts are descriptive enough that when someone runs it, he or she could use it easily without having to ask questions or running into trouble. All that your office receptionist would have to do is to show him/her the Run button. That's what user-friendly meansnot being polite or friendly to the user.C. PROCESSING:Remember the data processing cycle: INPUT-Store-PROCESSING-Store-OUTPUT. However, there will be no "number crunching"-type processing in this program. The main task here is to simply display the letter correctly. 1. Explain to the user (someone using your program) what this program does. Remember, that he or she would not understand your code and likely wouldn't see it. Don't use programmer jargon (like program, variable, etc.). However, make also sure that all your code is properly commented-refer to the TURING ASSIGNMENTS: Rules, Hints, Reserved Words handout. Please declare all


View Full Document

UNC-Chapel Hill COMP 004 - Lab-08A- Intro to Programming

Download Lab-08A- Intro to Programming
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 Lab-08A- Intro to Programming 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 Lab-08A- Intro to Programming 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?