CS102--Object Oriented Programming Discussion 1: – Project 4 on Page 328 – The use of arrays Copyright © 2008 Xiaoyan Li.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 1.
Advertisements

Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
Standard Algorithms Find the highest number. ! Your name and today’s date ! Find the maximum Dim numbers(20) As Integer.
Analysis of Algorithms
Aalborg Media Lab 2-May-15 Exercises/Summary Lecture 10 Summary, Exercises.
CS102--Object Oriented Programming
CS102--Object Oriented Programming Discussion 2: (programming strategy in java) – Two types of tasks – The use of arrays Copyright © 2008 Xiaoyan Li.
CS102--Object Oriented Programming Lecture 5: – Arrays – Sorting: Selection Sort Copyright © 2008 Xiaoyan Li.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Polymorphism.
1 COMP 110 Arrays Tabitha Peck M.S. March 31, 2008 MWF 3-3:50 pm Philips 367.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
Designing Algorithms February 2nd. Administrativia Lab assignments will be due every Monday Lab access –Searles 128: daily until 4pm unless class in progress.
Designing Algorithms Csci 107 Lecture 3. Designing algorithms Last time –Pseudocode –Algorithm: computing the sum 1+2+…+n –Gauss formula for 1+2+…+n Today.
CS107 Introduction to Computer Science Lecture 5, 6 An Introduction to Algorithms: List variables.
Designing Algorithms Csci 107 Lecture 3. Administrativia Lab access –Searles 128: daily until 4pm unless class in progress –Searles 117: 6-10pm, Sat-Sun.
CS102--Object Oriented Programming Lecture 6: – The Arrays class – Multi-dimensional arrays Copyright © 2008 Xiaoyan Li.
Designing Algorithms Csci 107 Lecture 4.
Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
CS102--Object Oriented Programming Review 1: Chapter 1 – Chapter 7 Copyright © 2008 Xiaoyan Li.
Introduction to Programming with C++ Fourth Edition
Java vs. You.
CS102--Object Oriented Programming Lecture 10: – Abstract Classes Copyright © 2008 Xiaoyan Li.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
FREQUENCY DISTRIBUTION. Objectives; Organize data in the form of frequency distribution Distinguish an exact limits, class mark, class intervals, cumulative.
CS1101: Programming Methodology Aaron Tan.
 Experiment 11 Structured and Unions Dr. rer.nat. Jing LU
1 Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
Part 2. Searching Arrays Looking for a specific element in an array E.g., whether a certain score (85) is in a list of scores Linear search Binary search.
ITEC 2620A Introduction to Data Structures
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Array Processing - 2. Objectives Demonstrate a swap. Demonstrate a linear search of an unsorted array Demonstrate how to search an array for a high value.
More While Loop Examples CS303E: Elements of Computers and Programming.
Introduction to Matlab Module #2 Page 1 Introduction to Matlab Module #2 – Arrays Topics 1.Numeric arrays (creation, addressing, sizes) 2.Element-by-Element.
Lecture 18/19 Arrays COMP1681 / SE15 Introduction to Programming.
Value and Reference Parameters. CSCE 1062 Outline  Summary of value parameters  Summary of reference parameters  Argument/Parameter list correspondence.
Thinking Mathematically
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
Computer Programming TCP1224 Chapter 11 Arrays. Objectives Using Arrays Declare and initialize a one-dimensional array Manipulate a one-dimensional array.
 I am going to calculate what the imaginary student, Suzie Que, must do to make the grade she seeks in this course.  To see what you must do, just follow.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
1 CSC103: Introduction to Computer and Programming Lecture No 24.
CHAPTER 6 ARRAYS IN C++ 2 nd Semester King Saud University College of Applied studies and Community Service CSC 1101 By: Fatimah Alakeel Edited.
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Count Controlled Loops (Nested) Ain’t no sunshine when she’s gone …
The number which appears most often in a set of numbers. Example: in {6, 3, 9, 6, 6, 5, 9, 3} the Mode is 6 (it occurs most often). Mode : The middle number.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Introduction to Arrays. Objectives Distinguish between a simple variable and a subscripted variable. Input, output, and manipulate values stored in a.
Pointer Lecture 2 Course Name: High Level Programming Language Year : 2010.
Lecture 3 Sorting and Selection. Comparison Sort.
1.8 Multidimensional Arrays academy.zariba.com 1.
For Friday Read No quiz Program 6 due. Program 6 Any questions?
CHAPTER 6 ARRAYS IN C 1 st semester King Saud University College of Applied studies and Community Service Csc 1101 F. Alakeel.
Arrays float Scores[9]; ? index: element // one dimensional array 1.
Chapter 7: Arrays. 7.1 Arrays Hold Multiple Values.
Introduction to programming in java Lecture 21 Arrays – Part 1.
Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
Chapter 6 Arrays in C++ 2nd Semester King Saud University
Calculations & Parameters
Microsoft Visual Basic 2005: Reloaded Second Edition
C++ Arrays.
CS149D Elements of Computer Science
Adapted from slides by Marty Stepp and Stuart Reges
Text Analyzer BIS1523 – Lecture 14.
Announcements Lab 7 due Wednesday Assignment 4 due Friday.
Chapter 14 Partial Derivatives. Chapter 14 Partial Derivatives.
Arrays Part 2.
AP Java 9/21/2018.
National Chiao Tung University
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises UTPA – Fall 2012 This set of slides is revised from lecture.
Presentation transcript:

CS102--Object Oriented Programming Discussion 1: – Project 4 on Page 328 – The use of arrays Copyright © 2008 Xiaoyan Li

Project 4 on Page 328 Classes Instance variables Methods

Project 6 on Page 409 Write a program that reads numbers from the keyboard into an array of type int[]. You may assume that there will be 50 or fewer entries in the array. Your program allows any number of numbers to be entered, up to 50 numbers. The output is to be a two-column list. The first column is a list of the distinct array elements; the second column is the count of the number of occurrences of each element. The list should be sorted on entreis in the first column, largest to smallest. Example array input : The output should be: N count

Exercise1: A student takes 5 courses this semester. write a program that read her scores from the keyboard, output her scores from the highest to the lowest and her average score.

Exercise2: There are 5 registered students in our class. Each takes 4 courses this semester. Write a program that read scores from the keyboard, calculate the average score for each student and output the average scores from the highest to the lowest.

Announcement Next Lecture: Inheritance Reading assignment: Chapter 7