Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using the Computer Turning it on – Your computers in the lab should be turned on, but if you arrive and the screen is blank, do the following: Hit the.

Similar presentations


Presentation on theme: "Using the Computer Turning it on – Your computers in the lab should be turned on, but if you arrive and the screen is blank, do the following: Hit the."— Presentation transcript:

1 Using the Computer Turning it on – Your computers in the lab should be turned on, but if you arrive and the screen is blank, do the following: Hit the return key to make sure the machine is not in power-saving mode Ask the lab instructor if the machine is turned off for a reason, like repairs Make sure it is plugged in. Press power button for the computer – probably in the middle front of the tower. Press power button for the monitor – probably below the screen. Turning it off (do one of the following and follow the instructions) Use the START button and select SHUT DOWN. Use ALT-CTRL-DELETE Unplug it Breaking it You can’t break the machine by typing anything wrong or turning it off or on. You can break it by forcing floppy discs into the wrong places.

2 Using the Computer Turning it off – you shouldn’t have to do turn the machine off during lab unless it stops responding completely. You will want to log off at the end of lab, though. Do one of the following and follow the instructions the machine provides. Click the START button (lower left corner of screen) and select SHUT DOWN. Then select “shut down”, “restart”, or “log off” from the menu. Use ALT-CTRL-DELETE then follow directions (particularly if the machine has stopped responding) Unplug it – last resort, ask lab instructor first. Breaking it You can’t break the machine by typing anything wrong or turning it off or on. You can break it by forcing floppy discs into the wrong places.

3 Using the Computer Breaking it – its pretty hard to break it. You can’t break the machine by typing anything wrong or turning it off or on. So don’t worry about experiementing with your programs. A good way to learn things like JavaScript is to say “I wonder what happens when I do THIS.” and then go do it. The worst that can happen is that you have to restart the machine. Deleting important files. This is possible, but hard to do by accident. You should always keep the lab machines free of your assignments. Bring floppy disks to lab to store your files on, or transfer them to Pegasus and then delete them from the lab machine. When you delete files, the machine will ask you if you are sure you want to do it. Be careful at this point – just verify that only the files you want deleted are selected before you hit the “ok” button. You can break it by forcing floppy discs into the wrong places.

4 Using the Computer Finding Files Use the “Find files” feature if you know the file name. Click “Start” and then “Find”. A quicker way (usually) is to traverse the directory structure using “My Computer” icon. Double click on the icon and then maneuver your way around the directory structure with more clicking. For the most part, you will only need to go to the “A:” directory (the floppy disk) and the Desktop. Editing files The main thing is to remember that your files must be text only. In other words, using MS Word with the default save settings will not work. My favorite program for editing in a text-only mode is Notepad. It comes standard on MS machines (usually click on Start, then Programs, then Accessories then Notepad). You may use any other editor you like, but make certain it saves in plain text format.

5 Some Notes on Programming Languages Syntax – the mechanical way that programs can be assembled Programming languages are very specific about syntax This means that putting in a single quote ‘ where a double quote “ should be can ruin your entire program. Putting a square bracket [ where a parenthesis ( should be can ruin your entire program. This can be frustrating. Capitalization almost always counts. Be conscious of things like that. Many things come in pairs (quotation marks, parenthesis for example). Make sure that things that should be in pairs are. If your program does absolutely nothing, you probably have a small syntax error. If your program does something, but its wrong, then you probably have an error in your logic when you designed the program.

6 Introduction to HTML HTML = Hypertext Markup Language Language HTML is A very weak computational language (basically nil). An interpreted language (interpreted by the browser). Designed specifically to tell browsers how to display web pages. Requires a browser for the page to be displayed. Can only suggest display preferences to the browser (this surprises a lot of people).

7 Structure of HTML HTML uses tags to suggest how to display items on a page Learning HTML is really about learning how to use the tags. Makes it easy to do useful pages quickly. Most tags come in pairs: starts the action stops the action Example: begins all html documents and ends them Example: Title will center the word “Title” on the page. Some tags do not come in pairs: is a line break, causing the display to continue on a new line inserts a horizontal rule (line) across the page.

8 Structure of HTML Anything that is not specified by tags is displayed per the browsers preference Adding extra spaces in between words won’t have any effect on the page. Putting things on a new line won’t have any effect on the displayed web page (the tag does that). Example: “Hello, World.” and “Hello, World.” will look the same. “Hello, World.” and “Hello, World.” will both be shown on the same line.

9 Structure of HTML There are 4 tags required in any HTML document. Tells the browser where the web page starts and stops Tells the browser where the informational portion of the web page starts and stops Tells the browser where the displayed portion of the web page starts and stops Tells the browser what title to display for this page.

10 Structure of HTML Example of HTML structure Information hidden from the viewer. Visible web page.

11 “Hello, World!” There is a particular, simple program called “Hello, World!” that many CS people use when first encountering a new language. “Hello, World!” prints the words “Hello, World!” on the screen. The idea is that if you can get this simple thing to work, then- You’ve learned how to write, save, and run the program. The language is working on your computer. Your computer is working as expected. So “Hello, World!” acts as a simple check that things are working ok before you get involved in a complicated programming effort.

12 An HTML Example Hello, World! Hello, World!

13 Introduction to JavaScript JavaScript Was developed to be compatible with web page design, so it runs inside of web page documents. That means that JavaScript programs sit inside of HTML documents. It allows computation to be performed within web pages, and uses the web page for input and output. The and tags define the limits of the JavaScript program inside of the HTML document. JavaScript is general purpose (fully computational language), but it is limited as to file access for security reasons. An interpreted language (interpreted by the browser). This makes it a little slow when running, but makes it easy to quickly change your program and see the result.

14 A JavaScript Example JavaScript Hello, World! document.write(“Hello, World!”);

15 Getting Started with JavaScript JavaScript requires that you declare every variable you intend to use. Declarations look like this for simple variables: var x; Var myvariable; JavaScript uses the following arithmetic operators on integers and numbers: + is addition - is subtraction * is multiplication / is division JavaScript has many special purpose functions built in for your convenience

16 Output of Results with JavaScript JavaScript is an Object-Oriented language, which means it treats everything as if it were a physical object. There are specific built-in objects with specific built-in functions. The object that deals with input and output is the “document” object. Outputting results with the document object looks like this: document.write(“Hi.”); -> Displays the word “Hi.” document.write(17); -> Displays the number 17 document.write(x);-> Displays the value of x. document.write(“x”);-> displays the letter “x”.

17 The Tiny Von Neumann Architecture 000 MEMORY 001 100 002 ADDRESS The Instruction Cycle: FETCH: Fetch an instruction from the memory address pointed to by the PC (Program counter), place it in the instruction register (IR) and increment the PC by one. EXECUTE: The OP tells the computer what is the instruction that must be executed. NOTE: The PC always points to the instruction that will be fetched. When the program is loaded in memory, the PC points to the first instruction of the program.

18 Instruction Set Architecture: LOAD Loads the contents of memory location “X” into AC (AC stand for Accumulator). ADD The data value stored at address “X” is added to the AC and the result is stored back in the AC. STORE Store the contents of AC into memory location “X”. SUB Subtracts the value located at address “X” from the AC and stored the result back in the AC. IN * A value from the input device is transferred into the AC. OUT * Print out the contents of the AC in the output device. END The machine stops execution of the program.

19 JMP Causes an unconditional branch to address “X”. PC  X SKIPZ If the contents of the Accumulator = 0 the next instruction is skipped. *Device #Device 5Keyboard 7Printer 9Screen For instance you can write: 003 IN “23” where “23” is the value you are typing in. Instruction Set Architecture continued

20 LOAD 0004 01  LOAD 02  ADD 03  STORE 04  SUB 05  IN 06  OUT 07  END 08  JMP 09  SKIPZ Instruction format assuming 6 digits, 2 are used for the op-code and 6 for the address, for example LOAD will be represented as: It can be written as “010004” using decimal numbers. Instruction Set Architecture Codes:


Download ppt "Using the Computer Turning it on – Your computers in the lab should be turned on, but if you arrive and the screen is blank, do the following: Hit the."

Similar presentations


Ads by Google