CSC116: Introduction to Computing - Java

Similar documents
CSC116: Introduction to Computing - Java

CSC116: Introduction to Computing - Java

Lesson 04: Our First Java Program (W01D4

You should see something like this, called the prompt :

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment.

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Introduction to Linux. Fundamentals of Computer Science

The Command Shell. Fundamentals of Computer Science

Setting up your Computer

Lab 1 Introduction to UNIX and C

Welcome to Solving Problems with Computers I

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

Intermediate Programming, Spring Misha Kazhdan

Introduction to Data Structures

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

CMSC 201 Spring 2018 Lab 01 Hello World

You will need to download the Java software development kit from

Introduction to Java. Java Programs Classes, Methods, and Statements Comments Strings Escape Sequences Identifiers Keywords

last time in cs recitations. computer commands. today s topics.

Programming Studio #1 ECE 190

Instructions. First, download the file

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CPSC 150 Laboratory Manual. Lab 1 Introduction to Program Creation

Spring 2018 El Camino College E. Ambrosio. Course Syllabus

Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide

CS CS Tutorial 2 2 Winter 2018

CMSC 201 Spring 2017 Lab 01 Hello World

Introduction to Linux for BlueBEAR. January

Welcome (back) to CS1007!

Intensive Introduction to Computer Science. Course Overview Programming in Scratch

Department of Computer Science University of Pretoria. Introduction to Computer Science COS 151

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

CSC 112 Lab 1: Introduction to Unix and C++ Fall 2009

AP Computer Science A Summer Assignment

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Parallel Programming Pre-Assignment. Setting up the Software Environment

Lab 1 Introduction to UNIX and C

LAB #5 Intro to Linux and Python on ENGR

CS 177 Recitation. Week 1 Intro to Java

CS110/CS119 Introduction to Computing (Java) Bob Wilson S-3-176

Outline. CIS 110: Introduction to Computer Programming. What is Computer Science? What is computer programming? What is computer science?

Announcements. Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment

COSC UNIX. Textbook. Grading Scheme

Certified Core Java Developer VS-1036

CS 241 Data Organization. August 21, 2018

Instructions PLEASE READ (notice bold and underlined phrases)

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

COMP-202 Unit 0: Course Details

CompSci 125 Lecture 02

Admin CS41B MACHINE. Midterm topics. Admin 2/11/16. Midterm next Thursday in-class (2/18) SML. recursion. math. David Kauchak CS 52 Spring 2016

Programming Studio #1 ECE 190

CPSC 213 Labs Cheat-Manual

Introduction to C Programming 計算機程式設計

CMSC 150 LECTURE 1 INTRODUCTION TO COURSE COMPUTER SCIENCE HELLO WORLD

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

15-122: Principles of Imperative Computation

Tutorial 1: Unix Basics

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Getting Started with UNIX

Lab 1: Introduction to C, ASCII ART & the Linux Command Line

Software Installation for CS121

Object-Oriented Programming for Managers

Getting Started With UNIX Lab Exercises

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

Once you have installed MobaXterm, open MobaXterm. Go to Sessions -> New Session, and click on the SSH icon.

Computers and Computation. The Modern Computer. The Operating System. The Operating System

Computer Science 62 Lab 8

CS 300. Data Structures

CS Fundamentals of Programming II Fall Very Basic UNIX

CSE 391 Lecture 1. introduction to Linux/Unix environment

Linux Exercise. pwd answer: We call this directory (into which you get when you log in) your home directory.

User Guide Version 2.0

AMS 200: Working on Linux/Unix Machines

IT151: Introduction to Programming (java)

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

Announcements. 1. Forms to return today after class:

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Getting Started with Java. Atul Prakash

Introduction. Overview of 201 Lab and Linux Tutorials. Stef Nychka. September 10, Department of Computing Science University of Alberta

AP Computer Science A Summer Assignment

Admin. ! Assignment 3. ! due Monday at 11:59pm! one small error in 5b (fast division) that s been fixed. ! Midterm next Thursday in-class (10/1)

CSE 390a Lecture 1. introduction to Linux/Unix environment

Lecture 4: Introduction to Java and your Development Environment

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

CHAPTER 1. Introduction to JAVA Programming

CSc 2310 Principles of Programming (Java) Jyoti Islam

Programming Assignment 2 (PA2) - DraggingEmoji & ShortLongWords

Getting started with Hugs on Linux

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

AMath 483/583 Lecture 2

AMath 483/583 Lecture 2. Notes: Notes: Homework #1. Class Virtual Machine. Notes: Outline:

sftp - secure file transfer program - how to transfer files to and from nrs-labs

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

SECTION 2: CODE REASONING + PROGRAMMING TOOLS. slides borrowed and adapted from Alex Mariakis and CSE 390a

Transcription:

CSC116: Introduction to Computing - Java

Course Information Introductions Website Syllabus Schedule Computing Environment AFS (Andrew File System) Linux/Unix Commands Helpful Tricks Computers First Java Program Text Editor Remote Access Java Download Intro to CSC116

Course Instructor: Instructors Mrs. Michelle Glatz, mlglatz@ncsu.edu Office Hours: Tues/Thurs 5:00 6:00 in DAN 200 and by appointment Email used to set up appointments Support email: group-csc116-glatz+007@ncsu.edu TAs: Varsha Gopal, vgopal2@ncsu.edu Office Hour: Fridays 11am 12pm in Daniels 200 Brenden Lech, bglech@ncsu.edu Office Hour: Wednesdays 5 6 pm in Daniels 200

Office Hours CSC116 Office Hours: http://go.ncsu.edu/csc116teachingstaffofficehours We will use My Digital Hand during office hours to manage questions: http://mydigitalhand.org You should have received an email invite Please register now

Textbook Building Java Programs A Back to Basics Approach 4th Edition Reges and Stepp NCSU CSC Department, Style Guidelines

Course Website Moodle login page: http://wolfware.ncsu.edu Moodle Course Page (direct link) course materials submit coursework feedback returned grade book

Moodle Syllabus Link Syllabus Schedule Link Schedule In class exercise due before end of class Other lab exercises due on Sunday night Assignments due at 11:45 pm

Course Structure The course structure is a mixture of lecturing and practicing as we go through material. The idea is to reinforce the learning of new material with hands on experience using it right away.

Exercises In-class: Group assignments completed in-class. Similar to examples Lab: Apply new concepts. Due Weekly. Practice-It! Exercises: Every 2 chapters turn in list of problems solved as Homework (screenshot pdf: cntrl-p, capture your userid) https://practiceit.cs.washington.edu/ create an account choose a problem from list Type a solution and submit it. The system will test it and tell you whether your solution is correct.

Programming Assignments There will be 6 programming projects in addition to the Lecture Exercises. MUST BE DONE INDIVIDUALLY!!

Academic Integrity Do your own work (projects) Don t copy from outside resources (don t google it!) Don t look at other student s code Don t show your code to another student See syllabus for violation penalties

Exams Two midterm exams One final exam Check the course schedule on our website for dates. Paper exams, closed book, closed notes, closed computer.

Message Board The course message board (Piazza) is a great place to ask questions and discuss topics with the Instructor, TAs, and all the other students in class piazza link The only rule is that you may not publicly post any code that directly comes from an assignment, but example code is permitted Make the question private if need to post your code. Post to Group 007 if specific to our section

Grading Minimum Grade Requirement Need a 73 to advance to CSC216 To earn a C- or higher you must: have an exam average of at least 60 AND have a project average of at least 60 Activity Weight Exercises: (.2 * In-class avg +.6 * Weekly Exercise avg +.2 * Practice-it! avg) Projects 30 Comprehensive Exercise 2 Exam 1 17 Exam 2 17 Final Exam 20 14

Regrade Requests The TA s will send out an email to inform you when they have completed grading of each assignment. To request a regrade (within one week): Send an email to the Teaching Staff support email with Regrade Request as the subject line. group-csc116-glatz+007@ncsu.edu Include the name of the assignment and why you think it should be regraded.

Computing Environment Review of E115 topics that will be important for the course. The materials come from the E115 Textbook (http://ncsu.orgsync.com/org/e115/)

AFS AFS: Andrew File System Distributed file system used to organize files, which is used at NC State Personal home directory /afs/unity.ncsu.edu/users/y/yourhome /afs/unity.ncsu.edu/users/m/mlglatz

Handy UNIX Commands cd pwd ls mkdir cp mv rm rmdir

Traverse Directory Tree & Find Current Location cd: change directory pwd: print working directory Log on, open a terminal window, and try entering these command at the prompt: cd.. pwd pwd cd username pwd cd../../.. pwd cd ( or cd ~ ) pwd

What s in a directory? ls: list contents of directory Try it: cd /afs/eos.ncsu.edu/courses/csc/ ls ls -l cd ls -a ls al

Organize your CSC116 Files mkdir make directory Try it: cd mkdir csc116 cd csc116 mkdir exercises mkdir projects cd exercises mkdir Lab1 cd Lab1

Helpful Tricks/Shortcuts Up/Down arrows Recall previous commands Tab completion Completes commands/file names Ctrl + C to regain command prompt if system is hung up

What you will learn in CSC116 Problem solving the purpose of writing a program is to solve a problem Java programming language Concepts of Object-Oriented Programming (OOP) encapsulated collection of data variables and methods Documentation techniques Testing methods

Hardware Software Number Systems Base 10 (decimal) Base 2 (binary) Bits and Bytes Programming Computers

Hardware The physical components that make up a computer: CPU (Central Processing Unit) Executes program instructions (brains) Memory (RAM) Used to store current program and data Hard Disk Permanent data storage

Computer programs Operating System Software Bridge between hardware, programs, user Allocates memory and send instructions to CPU Applications Programs run within the operating system

Binary and Decimal Typically, we (humans) use the base-10 (decimal) notation. Uses the digits 0 through 9 All information is stored on a computer as binary numbers 1 s and 0 s (base 2) 10 (1 * 2 1 + 0 * 2 0 ) = 2 base-10 11 (1 * 2 1 + 1 * 2 0 ) = 3 base-10 100 (1 * 2 2 + 0 * 2 1 + 0 * 2 0 ) = 4 base-10

Binary (Base-2) Binary and Decimal 2 4 2 3 2 2 2 1 2 0 16 8 4 2 1 Decimal (Base-10) 10 4 10 3 10 2 10 1 10 0 10,000 1,000 100 10 1

Convert between Decimal and Binary 20 Decimal to Binary (20 16 = 4, 4 4 = 0) 1 1 1 0 0 Binary to Decimal 2 4 2 3 2 2 2 1 2 0 1 1 1 0 0 16 8 4 0 0 16 + 8 + 4 + 0 + 0 = 28

Bits and Bytes Bit Binary Digit Byte 8 Bits Kilobyte (KB) 2 10 1024 bytes Megabyte (MB) 2 20 1,048,576 bytes Gigabyte (GB) 2 30 1,073,741,824 bytes

Programming Languages We can write a program using only 0s and 1s, but that has many disadvantages Hard to look at and understand Very tedious! We use a programming language instead - we write code in English instead of 0s and 1s, which is much easier to read and understand The code we write is interpreted by a program called a compiler, which translates our English into 0s and 1s for the processor to understand Java is the programming language we will use in this course

Computer Programming Algorithm - A step by-step description of how to accomplish a task. Program A list of instructions to be carried out by a computer. Computer Programming the art of designing and writing a group of instructions that the computer s processor executes.

Computing Environments Use Classroom/campus linux desktop computers During class, used for lecture demos Ensures that programs work on linux Connect Remotely to campus linux computers Work from home Need wifi connection Ensures that programs work on linux Work natively on your laptop Efficiently work at home No need for wifi Must transfer final files to afs and run using one of the other methods to ensure programs work on linux.

Windows: Remote Access https://www.itecs.ncsu.edu/software/catalog/ Run X-Win32 and then run PuTTY. X-Win32 is a X11 Windows System that enables you to display a Unix or Linux application with a graphical user interface (GUI) on your Windows computer. PuTTY is a SSH client that gives you terminal access to run commands and command-line applications (make sure to enable X11 forwarding). Click on application to download Macintosh: Brings you to software download page There is a documentation/installation link for each application. Download and Install XQuartz: https://www.xquartz.org/ Run XQuartz then open terminal window Application Utilities Terminal ssh -X -Y your_unity_id@remote.eos.ncsu.edu

File Transfer Transfer Files between Your Laptop and AFS https://www.itecs.ncsu.edu/software/catalog/ For the desired application: Click on supplication name Windows: Brings you to software download page Click on desired download Use FileZilla and/or WinSCP. Macintosh: Use FileZilla

Software You may download the Java 2 Standard Edition (J2SE) Software Development Kit (JDK) from http://www.oracle.com/technetwork/java/javase/downloads/index.html Download JDK version 8u191, DO NOT download version 11. Text Editor Campus Linux Computers gedit (gedit filename & - opens in new window) Mac TextWrangler, Aquamacs Windows Notepad++

Configure Editor Configure to convert tabs to 4 spaces https://pages.github.ncsu.edu/engr-csc116-staff/csc116- Materials/course-resources/style-guidelines-resources/text-editorspaces.html TextWrangler : Preferences->Editor Defaults->Auto-expand tabs Set tabs to 4 spaces restart TextWrangler for changes to take place Notepad++ : Settings->Preference->Language Set Tab size to 4 Check Replace by space box Gedit: gedit icon in the application bar (top of screen) Go to Preferences. Insert spaces instead of tabs

Java Download for Laptop The next set of slides show the java download and set up process. The current version on the download site is Version 11. We will be using version 8 The java version used for demonstration is version 8 update 152 (current version is 191) http://www.oracle.com/technetwork/java/javase/downl oads/index.html

Download Java Current Download is Version 11, don t download this one.

Download Java Page down to the following Version 8 downloads. Click on the JDK download

Accept Agreement

Installation Save the file to the desktop and run it Install to default location The installation screen should read (don't change it): Install to: C:\Program Files\Java\jdk1.8.0_152\

Installation

Install Directory

Setting the Path Windows Once the installer is finished, you must set your computer's path before Java will work correctly FOR WINDOWS ONLY Go to the Control Panel and double-click System Select the Advanced tab Click on the Environment Variables button Look under System Variables for "Path" Click on "Path" and then click edit Add the following to the end of the Path: ;C:\Program Files\Java\jdk1.8.0_152\bin Click OK.

Setting CLASSPATH - Windows Look to see if there is a variable named CLASSPATH If there is not, then Click the "New" button. For the variable name, type: CLASSPATH For the value, type:.; (that period semicolon) Click OK. Exit out of all the open windows

Installed Correctly? Open up a command prompt. On Windows: Open Command Prompt - On MAC OSX: Open the Applications folder, open the Utilities folder, then open the Terminal application. Type java and hit enter "command not found means java is not installed correctly list of options for running java means installed ok Type java -version and hit enter It should list version you installed (e.g. 1.8.0_152)

Write Compile Execute A human writes Java code, known as source code (.java file) gedit HelloWorld.java & The Java compiler converts the source code into machine code or byte code (.class file) javac HelloWorld.java The computer has a Java Virtual Machine (JVM), which translates the byte code into instructions that the specific computer s processor can understand. java HelloWorld A.class file can be used on any computer that has a Virtual Machine, no matter what platform the class file was created on (platform independence) Output messages printed to the screen

Classic First Program Write a program that prints the text Hello, World! to the screen public class HelloWorld { public static void main(string[ ] args) { System.out.println( Hello, World! ); } } RULE: The name you give your class MUST be the same name you give your file. Thus, the above program must be saved in a file called HelloWorld.java

In-Class Assignment Go to our Moodle page and work on the HelloWorld.java assignment: /** * This is an example class that illustrates printing a message to the screen * * @author YOUR NAME */ public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World! My name is [put your name here]."); System.out.println("I [am new to programming, have done some Java/C/etc. programming]."); System.out.println("I am a [freshman, sophomore, junior, senior] in the [department name] department."); System.out.println("At home, I use a [pc, mac, etc] with the [Windows 7/8/10, OSX, Linux, etc] operating system."); } }