1 / 20

COSC 1323.01 Dr. John Camden TR 11:00

COSC 1323.01 Dr. John Camden TR 11:00

viveka
Download Presentation

COSC 1323.01 Dr. John Camden TR 11:00

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COSC 1323.01 Dr. John Camden TR 11:00 Syllabus COSC 1323 Concepts IClass protocol (what is a protocol?)Homework each week. Due before class starts on ThursdaysSyllabus COSC 1123 Concepts I Lab Advanced Computing Lab JBWS 166Labs due each Friday by the end of the day.Turn labs in to Dr. Camden or JBWS 273 box Note: do not turn in to Dr. Baker (she will lose it!) Class Website Schedule faculty.stedwards.edu/johnc Notes are intended as outline of class lectures. Not comprehensive.

  2. What is a ‘computer program’? What is a foreign language?Why learn it? CommunicateExpress fact, idea, request, … CA What is a Computing Appliance? (CA) How do you get a CA to accomplish something for you? Computing Appliance

  3. What is a ‘computer program’? What is a foreign language?Why learn it? CommunicateExpress fact, idea, request, … CA What is a Computing Appliance? (CA) How do you get a CA to accomplish something for you? Computing Appliance Desktop, Laptop, ipad, smart phone, swipe card system, …

  4. CA Our ability to communicate ideas and thoughts is critical to our success --- In order to communicate, what do we need? (communicate to what?, who? … Examples of communication tools recipes Computing Appliance Server, database system, web site

  5. To get a CA to accomplish a task – What is the ‘task’ that you need done? Actually, this is the hard part – articulating what a task is and how to accomplish it. This is what our class is about. We want to be able to know the task to be accomplished and to be able to articulate this in a manner that everyone in the world can understand our plan without any ambiguity.

  6. Vocabulary Algorithm Logical expression Source Code CA (Computing Appliance) C++, Fortran, Xcode, Objective-C, java, SQL Articulating an algorithm – flowchart, pseudocode Flowchart symbols, example or 2 or 3 See Schedule referencesFlowcharts are a critical, important piece of our class. Flowcharts by hand are great, diagramming software is available (see Schedule reference).

  7. Computer Systems Nodes, servers, communicationComputer Science Computer System – completely separate from the Administrative System (Edweb/ Edshare) ACL server: cn01.cs.stedwards.edu Example: Username: khyde Password: xp13wn (how do I get ‘logged in’ to work?) How do I change my password? passwd command What is my ‘home’ directory? Path name: /seu/cs/home/user/k/khyde

  8. Computer programming – writing instructions (algorithm) for the CA to follow. Instructions are saved in a file (called source code). We will be writing using the language java. As with any language, lots of specific syntax rules. The source code file / document is scrutinized for violations of the java syntax rules by a java compiler.Example – submit an English paper. What/who checks what? If there are no errors, this is called a ‘clean compile’ and the compiler automatically creates a file, a byte code file, with extension .class So: Program seu01.java is compiled ( use javac seu01.java ) on the command line. If the file has errors, you must go back and fix the errors and compile again. If no errors, run the program (use java seu01 ) * Note what the file extensions are (or aren’t) *

  9. Three types of errors in computer programming Compute the area of a circle: area = 2* r*r*r (2 times r cubed) Logic error --- Jill said hi to Bill and I. Syntax error (actually not java but you get the drift – violated a rule) --- Compute 12 / 0 Run-time error --- Syntax errorLogic error Run-time error Who catches these?

  10. java reserved words and variable names If we want to add 2 numbers, we want to reserve some space in memory to store them and we want to give them a name. Also, we need a name for the sum. We can make up any name we want – except we have to play by the rules. Oh man – more rules… a) Java reserves some words for itself. Examples: public, or, if, … b) Our names must begin with a letter, contain no imbedded special characters, including a space (actually you can use _ in a name)Get 100! Pick the valid java user-declared variable names: num1 , myNum , your number , 13ElmStreet , for , r2d2 , jlo , halo , fire , fire! , what? , squareLength , st.edwards ,

  11. Output to the screen/ console / terminal / panel (a rose by any other name …) System.out.println(“Hi”); java statement prints: Hi System.out.println(“Go for it!”); prints: Go for it!System.out.println(“Hello “ + “Bill”); prints: Hello Bill Command Line Interface (CLI) Graphical User Interface (GUI)

  12. The variable n1 starts with the value 10. The variable n2 starts with the value 2. The variable n3 starts with the value 4. Store the value of n1 times n2 in n1. Store the value of n2 times n3 in n3. Add n1 and n3, and store the result in n2. Display the value in n2 on the screen. We will do a Hand Trace and Output and memory space reservation (Board work)

  13. Lab 1 / Homework 1 Sample flowchart pseudocode Write the steps to compute the distance traveled by a car averaging 40 miles per hour that traveled 51 minutes. Note: reserve a space on your desk to remember things. That space may be volatile, but use it while you need it. Flowchart Pseudocode Start Reserve space for speed, distance, time Compute distance = speed * time (hey – is 51 minutes .51??) Write “The distance traveled was “ + distance Hey - I thought + was the addition operator! concatenation – don’t misspell it on the first test

  14. COSC 1123 What is Lab 1 about? What do I do? Turn in? where? Handout of Lab 1 putty/secureSSH Go through each step Connect to ACL cn01.cs.stedwads.edu Client (node) Username: yourSEUuseridPassword: xp13wn Create a new directory: mkdir cosc1123 Change to that directory: cd cosc1123 Create a new file: emacs seu01.java emacs is an editor

  15. Let’s login to the ACL computer system Handout – lab 1 Handout - seu00.java

  16. User-defined variable names (see page 20 for keywords) Data types 6 a hello 2.7 8283 integer character String floating point integer In java 6 ‘a’ “hello” 2.7 8283 int,short,long char String double, float int, short, long Declaring a variable int score = 0; double gpa = 2.8; String fname = “Jill”; String greeting = “What’s up?”; score = 85;

  17. Probably Thursday To obtain user input from the terminal: • import java.util.Scanner; • Scanner console = new Scanner(System.in); • gpa = console.nextDouble ( ); Example: (after having 1 and 2 in your program:double gpa = 0;System.out.println (“Please enter your gpa: “);gpa = console.nextDouble( ): get gpa

  18. Class Quiz Day 1 What must be done to a recipe for sugar cookies written in French in order for me to make sugar cookies? You can make up words to be used in your programs. But some words are “reserved” in the java language. What does that mean?What is a CA? T/F__ Late homework is accepted. __ Late labs are accepted. __ Main memory in a CA is volatile __ We have labs and HW due every week

  19. Let’s login to the ACL computer system Handout – lab 1 Handout - seu00.java

More Related