CS 2430 Day 1. Agenda Load NetBeans Introduction Syllabus Review some array operations.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Monday, 11/11/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Monday, 11/11/02  Questions? HW 04 due today at 5.  Today – Lists and an introduction to searching.
Basic Control Structures Control order of execution of statements sequential selection iteration - Repeat some action while a certain condition is true.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
CS 106 Introduction to Computer Science I 02 / 18 / 2008 Instructor: Michael Eckmann.
What Data Do We Have? Sections 2.2, 2.5 August 29, 2008.
Slide 1 Summary Two basic concepts: variables and assignments Some C++ practical issues: division rule, operator precedence  Sequential structure of a.
Simple Arrays COMP104 Lecture 11 / Slide 2 Arrays * An array is a collection of data elements that are of the same type (e.g., a collection of integers,characters,
1 9/24/07CS150 Introduction to Computer Science 1 Relational Operators and the If Statement.
Announcements Quiz 1 Next Week. int : Integer Range of Typically -32,768 to 32,767 (machine and compiler dependent) float : Real Number (i.e., integer.
Wednesday, 12/11/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Wednesday, 12/11/02  QUESTIONS??  Today: CLOSING CEREMONIES!  HW #5 – Back Monday (12/16)
1 11/27/06CS150 Introduction to Computer Science 1 Searching Arrays.
CS150 Introduction to Computer Science 1
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
Java Syntax Primitive data types Operators Control statements.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
CS 106 Introduction to Computer Science I 10 / 04 / 2006 Instructor: Michael Eckmann.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
CS 106 Introduction to Computer Science I 02 / 20 / 2008 Instructor: Michael Eckmann.
1 9/08/06CS150 Introduction to Computer Science 1 Arithmetic Operators.
1 CS 105 Lecture 3 Constants & Expressions Wed, Jan 26, 2011, 4:15 pm.
Computer Science 1620 Arrays. Problem: Given a list of 5 student grades, adjust the grades so that the average is 70%. Program design: 1. read in the.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
The If/Else Statement, Boolean Flags, and Menus Page 180
Wednesday, 11/6/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 11/6/02  QUESTIONS?? – HW # 4 due Monday  Today:  Return HW #3  Arrays (Chap. 10)  Reading:
CS 106 Introduction to Computer Science I 02 / 19 / 2007 Instructor: Michael Eckmann.
Admin Office hours 2:45-3:15 today due to department meeting if you change addresses during the semester, please unsubscribe the old one from the.
CSC 142 J 1 CSC 142 Arrays [Reading: chapter 10].
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
Java Building Elements Lecture 2 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Elements of a C++ program 1. Review Algorithms describe how to solve a problem Structured English (pseudo-code) Programs form that can be translated into.
CHAPTER 07 Arrays and Vectors (part I). OBJECTIVES 2 In this part you will learn:  To use the array data structure to represent a set of related data.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
Review Binary Numbers Bit : 0 or 1 Byte: 8 bites 256 different values 2 8 KB : 1024 bytes 2 10 bytes MB : 1024 * 1024 bytes 2 10 * 2 10 (2 20 ) bytes GB.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Introducing C++ Programming Lecture 3 Dr. Hebbat Allah A. Elwishy Computer & IS Assistant Professor
Chapter 2: Introduction to C++. Language Elements Keywords Programmer-defined symbols (identifiers) Operators Punctuation Syntax Lines and Statements.
Before we get started…. First, a few things… Weighted Grading System Programming Style Submitting your assignments… The char and string variable types.
1 CS 1430: Programming in C++. 2 Find Max, Min, Average of m Sections Max, Min and Average of each section Max, Min and Average of all sections together.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
12/14/2016CS150 Introduction to Computer Science 1 Announcements  Website is up!   All lecture slides, assignments,
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Arrays Chapter 12. Overview Arrays and their properties Creating arrays Accessing array elements Modifying array elements Loops and arrays.
Java & C++ Comparisons How important are classes and objects?? What mechanisms exist for input and output?? Are references and pointers the same thing??
Midterm Review Tami Meredith. Primitive Data Types byte, short, int, long Values without a decimal point,..., -1, 0, 1, 2,... float, double Values with.
CS 115 OBJECT ORIENTED PROGRAMMING I LECTURE 11 GEORGE KOUTSOGIANNAKIS 1 Copyright: 2015 Illinois Institute of Technology_ George Koutsogiannakis.
CS 1430: Programming in C++.
CS0007: Introduction to Computer Programming Primitive Data Types and Arithmetic Operations.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
CS 1430: Programming in C++.
Repetition Statements
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
Principles of Computer Programming (using Java) Chapter 2, Part 1
One-Dimensional Array Introduction Lesson xx
COMPUTER 2430 Object Oriented Programming and Data Structures I
CS 1430: Programming in C++ No time to cover HiC.
Counting Loops.
CS150 Introduction to Computer Science 1
CS 1428 Final Exam Review.
CS 1430: Programming in C++.
Summary Two basic concepts: variables and assignments Basic types:
CS150 Introduction to Computer Science 1
Java Programming Review 1
Comparing Python and Java
Presentation transcript:

CS 2430 Day 1

Agenda Load NetBeans Introduction Syllabus Review some array operations

Contact information Name: Scott Summers Web: Phone: Office: Ulrich 214 Office hours: See “schedule” on my webpage

About me Starting fifth semester at UW—Platteville Education: –BS: UW-Green Bay, 2004 –MS: Iowa State University, 2007 –PhD: Iowa State University, 2010 Studied theory of computation ISU: home of the first (non-programmable) electronic digital computing device Atanasoff-Berry Computer (ABC)

Course homepage

Course work 3 exams (60 points each) 180 Final exam quizzes (drop lowest quiz) 50 Programs and labs 170 ___________________________________ TOTAL 500

Grading scale Course Grade Points Percentage Grade Points A % 4.0 A % 3.7 B % 3.3 B % 3.0 B % 2.7 C % 2.3 C % 2.0 C % 1.7 D % 1.3 D % 1.0 F below

Syllabus Read the rest of the syllabus on your own time!

Any questions?

CS 243 versus CS 143 CS 143: C++ HiC CS 243: Java NetBeans All methods, including “main()”, are contained inside of classes

Java and NetBeans How to create a new project? (Lab 1) Uncheck “Set As Main Project” Uncheck “Create Main Class” The filename is case sensitive Mind the location!

Transition from C++ to Java If you know C++ syntax, then you will find Java syntax familiar You already know how to do a lot of stuff in Java such as –Declare variables –Write loops –Process (but not declare) arrays –Call methods

Primitive data types TypeSize (bits)Default value char 16‘\u0000’ int, short, long 32, 16, 640, 0, 0L float, double 32, 640.0f, 0.0d boolean ??? false byte 80

Some syntax int value, total = 0, rem, quot; value = 5; if (value > 0) total += value; else { rem = value % 5; quot = value / 5; } // Declaration statement // Assignment statement // Conditional statement // Braces needed for statement // block Is this Java or C++ code? It’s both!

A while loop in C++ int count = 0, total = 0; while (count < 100) { ++count; // performs the increment before doing // anything else (highest precedence), same // as "count++" in this case total += count; }

A while loop in Java int count = 0, total = 0; while (count < 100) { ++count; // performs the increment before doing // anything else (highest precedence), same // as "count++" in this case total += count; } No difference! Same with “for” loops—Java and C++ have same syntax

Input and output C++ cin >> value; cout << "The value: " << value; cout << "The value: " << value << endl; Java // We will discuss input later in the course! System.out.print("The value: " + value); System.out.println("The value: " + value);

Any questions?

Go to:

Review array operations Do you remember how to do these? Declare an array Add to the end Delete and maintain relative order Delete and do not maintain relative order Linear search Mean (average) Sort (discussed later in the course!)

Array organization C++ int intArray[50]; // Array of size 50 // Indexed from 0 to 49 Java // Array is a class in Java int [] intArray; // int[] intArray; // int intArray[]; // To get an array object, use // the new keyword (literally!) intArray = new int[50]; intArray∙ ∙ ∙

Array declaration final int MAX_SIZE = 10; // same as const from C++ int xVal, size = 0; int intArray[]; intArray = new int[MAX_SIZE]; // could use a non-constant variable // intArray: array of integers // MAX_SIZE: the maximum number of values of intArray // size : the actual number of values of intArray int len = intArray.length; // no ()'s // returns the length of the array, // NOT the number of elements in the // array