Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "CS 2430 Day 1. Agenda Load NetBeans Introduction Syllabus Review some array operations."— Presentation transcript:

1 CS 2430 Day 1

2 Agenda Load NetBeans Introduction Syllabus Review some array operations

3 Contact information Name: Scott Summers Email: summerss@uwplatt.edu Web: http://www.uwplatt.edu/~summerss Phone: 608-342-1516 Office: Ulrich 214 Office hours: See “schedule” on my webpage

4 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)

5 Course homepage http://www.uwplatt.edu/csse/Courses/CS243

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

7 Grading scale Course Grade Points Percentage Grade Points A 460 - 500 92% 4.0 A- 445 - 459 89% 3.7 B+ 430 - 444 86% 3.3 B 410 - 429 82% 3.0 B- 395 - 409 79% 2.7 C+ 380 - 394 76% 2.3 C 360 - 379 72% 2.0 C- 345 - 359 69% 1.7 D+ 325 - 344 65% 1.3 D 300 - 324 60% 1.0 F below 300 0.0

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

9 Any questions?

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

11 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!

12 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

13 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

14 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!

15 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; }

16 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

17 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);

18 Any questions?

19 Go to: https://xray.ion.uwplatt.edu/summerss

20 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!)

21 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∙ ∙ ∙ 0148249 50

22 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


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

Similar presentations


Ads by Google