King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

Size: px
Start display at page:

Download "King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department"

Transcription

1 King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS203, 1 st Term 2013 Program 2: KAU Air Booking System (Objects & Classes) Assigned: Wednesday, October 17 th, 2012 Due: 1:00PM on Monday, November 4 th, 2012 Read Carefully: The deadline for this project is 1:00 PM on Monday November 4 th, WARNING: This is an individual project; you must solve it by yourself. Any form of plagiarism will result in receiving zero in the project. WARNING: Late submission will not be accepted. Any project submitted after the cutoff time will receive zero. This project has to be submitted online via to: Cpcs.203@hotmail.com The subject line of your message should be as the following form: SectionNumber_StudentID_ProjectNumber Example: EA_ _ P1 The source file(s) of your program should be zipped up. You must name the zip file using the following naming convention: SectionNumber_StudentID_ProjectNumber.zip Example: EA_ _ P1.zip You will be given 10 minutes to demonstrate your project. Questions asked will be related to the working of your project (program). This project worth 4% of the overall module marks (100%). The project discussion will start on Saturday, the 10 th of November, 2012 and will remain for one week only, it is advised that you contact your project discussion teacher next week to fix a time/schedule for project discussion. For project discussion, check the teacher name below: Teacher Name (Location) Section Names Mr. Asif I. Khan (I st floor, Room No. 134) AA Mr. Abdullah (I st floor, Room No. 148) CA Mr. Mohammed Imran (I st floor, Room No. 148) BA, ZA, ZC

2 Program 2: KAU Air Booking System Objective Learn how to use classes and objects to create more powerful programs. Program Description This program is an extension of Program 1. The overall idea is the SAME. You will write a program to assign tickets/seats AND passengers for a commercial airplane. The airplane has 12 rows, with 7 seats in each row. Rows 1 and 2 are first class. Rows 3 to 7 are business class, and rows 8 to 12 are economy class. You must display the following menu to the user: Welcome To KAU Air --- Seat Reservation System Book First Class Seats 2. Book Business Class Seats 3. Book Economy Class Seats 4. View Air Plane Seating Assignment 5. View Passenger List 6. System Status 7. Know Fair 8. System Reset 9. Exit From The Booking System Enter Your Choice: In this menu, there are two new options: View Passenger List (option 5) and System Status (option 6). All of the options, including these two new ones, will be discussed in detail starting on page 5. *** Difference between Program 1 and Program 2 *** For Program 2, each time you book a seat, that seat will have a specific ticket issued and a specific passenger will sit at that seat. Therefore, each booked seat will be represented by an object of type Ticket. Also, each ticket object will have a reference variable (psngr) that will point to (refer to) an object of type Passenger. You will need to use three *.java files, as follows: 1. Ticket.java : this file will have the Ticket class. You will make Ticket objects from the Ticket class. 2. Passenger.java : this file will have the Passenger class. You will make Passenger objects from the Passenger class. 3. KAUairBookingSystem.java : this file will contain main and all other auxiliary methods used or needed by your program.

3 For Program 1, you used a 2-d array of integers to represent the seats: 0 meant the seat was available, and 1 meant that the seat was taken (booked). Perhaps you declared your 2-d array as follows: int[][] x = new int[12][7]; Now, for Program 2, you will have a 2-d array of object references. Remember, in JAVA, we do not have a 2-d array of actual objects. Instead, we have a 2-d array of object references. Each cell of the array is a reference that refers to an object that you must create. ***For more information, see the notes on Chapter 8, Objects & Classes (pages 74 77). As an example, if you want your array variable to be called ticket, you can declare and create your array as follows: Ticket[][] ticket = new Ticket[12][7]; What does this line do? It creates a 12x7 (two dimensional) array of references. Note: each reference has a default value of null. Until now, we have NOT created any objects. Now, for example, you could create a new Ticket object and store the reference to that object at index [0][0], as follows: Ticket[0][0] = new Ticket(); So now, the reference at Ticket[0][0] does not store null. Instead, it stores an address to the new Ticket object we just created. The seat at index Ticket[0][0] is now booked. When you make a new Ticket object, new Ticket(), the constructor for the Ticket class is invoked to initialize the Ticket object. Here, inside the Ticket constructor, you will create a new Passenger object, and you will save the reference (address) of that object into the variable psngr. So now, the Ticket object is created and one of its data members is psngr, which is a variable pointing to a Passenger object. See the diagram below: Ticket Object int ticketnumber; // other variables Passenger psngr; Passenger Object String fname; String lname; int ID; ticket *the n stands for null n n n n n n

4 Description of the three Java Files (Classes) 1. Here is the UML diagram for the Ticket class (Ticket.java): There are 6 data members in this class. The first 4 data members are static (UML says package ). These variables are shared by ALL objects of the Ticket class. 1) numfirstclass is an int that stores the total number of First Class tickets 2) numbusinessclass is an int that stores the total number of Business Class tickets 3) numeconomyclass is an int that stores the total number of Economy Class tickets 4) ticketcounter is an int that represents the first ticket number assigned in the program. For example, the first seat assigned will get the ticket number KAU Then, ticketcounter is incremented. As a result, the next seat assigned will be given the ticket KAU ) ticketnumber is an int that stores that actual ticket number for that specific Ticket object 6) psngr is a reference variable of type Passenger. This variable will store a reference to the Passenger object belonging to this ticket. The actual Passenger object will get created inside the constructor, Ticket(). This class has three methods: 1) Ticket() is the constructor. The constructor should do the following: It should save the current ticketcounter value into ticketnumber ticketnumber = ticketcounter++; See item 4 (above) for more information on what this line does. It should also create a new Passenger object as follows: psngr = new Passenger(); So now psngr stores a reference to the new Passenger object 2) getticketnumber() is the accessor method to get the ticketnumber 3) getpsngr() is the accessor method, which returns a reference to the Passenger object pointed to by this Ticket object.

5 2. Here is the UML diagram for the Passenger class (Passenger.java): This class has three private data fields, fname (first name), lname (last name), and ID This class has 7 methods 1) The first method is the constructor, Passenger(). This method should initialize fname and lname to unassigned This method should also initialize ID to -1. The other 6 methods are the standard accessor/mutator methods 3. The third java file should be called KAUairBookingSystem.java. KAUairBookingSystem.java This is your main program. This class file will have main and all of the other methods to run your program. The functionality of main will remain the same. You must display the menu, scan the user input (choice), and then perform appropriate methods. The following methods must be inside the KAUairBookingSystem.java file: 1. public static void showmenu() The menu gets printed/displayed on the screen. 2. public static void bookfirstclass(ticket[][] ticket, Scanner input, double ff) We send to this method three parameters: (1) a reference to the 2-d array of tickets, (2) a reference to the Scanner object, and (3) the cost of the first class fair (ff). You must first ask the customer how many seats they want, and then you will use the Scanner variable, input, to scan/save their input. The customer can requested more than one seat, and you must first make sure the seats are available. If the seats are available, you will create a new Ticket object for each seat requested. Once you create a new Ticket object, you must then scan the first name, last name, and ID of

6 the passenger and save them into the Passenger object. Finally, you will print a confirmation message. This message should print the first name, last name, ID, seat number, and ticket number for the passenger. (see sample output file). If the seats are not available, you should print an appropriate message (see sample output file). 3. public static void bookbusinessclass(ticket[][] ticket, Scanner input, double bf) We send to this method three parameters: (1) a reference to the 2-d array of tickets, (2) a reference to the Scanner object, and (3) the cost of the business class fair (bf). This methods works exactly like the previous methods, except that it works on Business Class. 4. public static void bookeconomyclass(ticket[][] ticket, Scanner input, double ef) We send to this method three parameters: (1) a reference to the 2-d array of tickets, (2) a reference to the Scanner object, and (3) the cost of the business class fair (bf). This methods works exactly like the previous methods, except that it works on Economy Class. 5. public static void displayseat(ticket[][] ticket) We send to this method the 2-d array of Ticket references. The method should display the current seating assignment (see sample output file). ***Hint: if (Ticket[i][j] == null), this means that no one is booked in that seat. If (Ticket[i][j]!= null), this means that the seat is booked and this index stores a reference to a specific Ticket object. 6. public static void passengerlist(ticket[][] ticket) We send to this method the 2-d array of Ticket references. The method should print out a list of all passengers booked on the flight (see sample output file). ***Hint: To do this, you must iterate over the 2-d array of references. If the reference does not equal null, this means that the seat is booked, and it means that a passenger is sitting there. So you must print out this passenger! However, from main, you do NOT have direct access to the fname, lname, and ID data fields of the Passenger object. From main, you only have access to the data fields of the Ticket objects. As such, you must invoke the getpassenger() method of the Ticket class. This method returns a reference to the Passenger object pointed to by this Ticket object. Of course, you must store this reference inside main. Here is an example of this: Passenger p1; p1 = ticket[i][j].getpsngr(); Now, from main, you have direct access to a specific Passenger object. As such, you can now use the mutator methods of the Passenger class (getfname, getlname, getid)to print the passenger data. 7. public static void statussystem(ticket[][] ticket, double ff, double bf, double ef) We send to this method four parameters: the 2-d array of Ticket references and the three prices for the cost of the fare. If at least one seat has been assigned, this method should display the total number of passengers booked in each class and the Total Fare paid for each class. If no seats are booked, an error message should be displayed (see sample output file).

7 8. public static void knowfair(double ff, double bf, double ef) This method simply prints out the fare (see sample output file). 9. public static void resetsystem(ticket[][] ticket) We send to this method the 2-d array of Ticket references. The method should reset the system. This means that all cells in the 2-d array should be reset to null. Note: before performing the reset, you must confirm with the user by asking them if they are sure they want to perform a system reset. If they answer y or Y, then you should reset the system and print an appropriate message (see sample output file). 10. public static void main(string[] args) Of course, you must have a main method to test your system. Output Format Your program should output in a similar format to the sample provided (see below). Sample and Output Files A sample run of the program will be provided on Moodle. Study this output carefully and make sure your program works similarly. Grading Details Your program will be graded upon the following criteria: 1) Adhering to the implementation specifications listed on this write-up. 2) Your algorithmic design. 3) Correctness. 4) Use of Classes and 2-d array of objects. If your program does not use objects, you will NOT get credit for the assignment. Period. 5) The frequency and utility of the comments in the code, as well as the use of white space for easy readability. (We're not kidding here. If your code is poorly commented and spaced and works perfectly, you could earn as low as 80-85% on it.) 6) Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Deliverables You should submit three files: 1. Ticket.java 2. Passenger.java 3. KAUairBookingSystem.java NOTE: your name, ID, section number should be included as comments in all files!

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 1 st Term 2014 Program 2: FCIT Baqalah Assigned: Thursday, September 26 th, 2013 Due: Wednesday,

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 3 rd Term 2014 (Summer) Program1: FCIT Samba Bank Assigned: Wednesday June 11 th, 2014 Due:

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 2 nd Term 2014 Program 2: KAU Grade Book (Linked Lists) Assigned: Thursday, February 20 th,

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 1 st Term 2014 Program 1: FCIT Baqalah Assigned: Monday, February 10 th, 2014 Due: Thursday,

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 2 nd Term 2014 Program 5: FCITbook Assigned: Thursday, May 1 st, 2014 Due: Thursday, May 15

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS204, 3 rd Term 2014 (Summer) Program 2: FCIT Mobily (Linked Lists) Assigned: Wednesday, June 18

More information

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS202, 1 st Term 2016 (Fall 2015) Program 5: FCIT Grade Management System Assigned: Thursday, December

More information

Project#1: Grade Book

Project#1: Grade Book Project#1: Grade Book Objective Making Classes and Objects from these Classes. Also, practice making an array of objects and manipulating/using the data inside said array. Program Description This program

More information

Homework Assignment #3

Homework Assignment #3 CS 540-2: Introduction to Artificial Intelligence Homework Assignment #3 Assigned: Monday, February 20 Due: Saturday, March 4 Hand-In Instructions This assignment includes written problems and programming

More information

Programming Assignment #2

Programming Assignment #2 Programming Assignment #2 Due: 11:59pm, Wednesday, Feb. 13th Objective: This assignment will provide further practice with classes and objects, and deepen the understanding of basic OO programming. Task:

More information

Final Exam Practice. Partial credit will be awarded.

Final Exam Practice. Partial credit will be awarded. Please note that this problem set is intended for practice, and does not fully represent the entire scope covered in the final exam, neither the range of the types of problems that may be included in the

More information

CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 8 Assigned: October 26, 2016 Due: November 2, 2016 by 2:30pm

CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 8 Assigned: October 26, 2016 Due: November 2, 2016 by 2:30pm 1 CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 8 Assigned: October 26, 2016 Due: November 2, 2016 by 2:30pm Objectives To enhance your experience with designing and implementing your own

More information

CSCI 1301: Introduction to Computing and Programming

CSCI 1301: Introduction to Computing and Programming This lab is not meant to be completed in a single lab period - it is broken up into two parts and there are two files to submit. Please complete part 1 before going to part 2. Part 1 Introduction In this

More information

H212 Introduction to Software Systems Honors

H212 Introduction to Software Systems Honors Introduction to Software Systems Honors Lecture #04: Fall 2015 1/20 Office hours Monday, Wednesday: 10:15 am to 12:00 noon Tuesday, Thursday: 2:00 to 3:45 pm Office: Lindley Hall, Room 401C 2/20 Printing

More information

9/19/2018 Programming Data Structures. Polymorphism And Abstract

9/19/2018 Programming Data Structures. Polymorphism And Abstract 9/19/2018 Programming Data Structures Polymorphism And Abstract 1 In-class assignment: deadline noon!! 2 Overview: 4 main concepts in Object-Oriented Encapsulation in Java is a mechanism of wrapping the

More information

EE 422C HW 6 Multithreaded Programming

EE 422C HW 6 Multithreaded Programming EE 422C HW 6 Multithreaded Programming 100 Points Due: Monday 4/16/18 at 11:59pm Problem A certain theater plays one show each night. The theater has multiple box office outlets to sell tickets, and the

More information

CS 116. Lab Assignment # 1 1

CS 116. Lab Assignment # 1 1 Points: 2 Submission CS 116 Lab Assignment # 1 1 o Deadline: Friday 02/05 11:59 PM o Submit on Blackboard under assignment Lab1. Please make sure that you click the Submit button and not just Save. Late

More information

This exam is open book. Each question is worth 3 points.

This exam is open book. Each question is worth 3 points. This exam is open book. Each question is worth 3 points. Page 1 / 15 Page 2 / 15 Page 3 / 12 Page 4 / 18 Page 5 / 15 Page 6 / 9 Page 7 / 12 Page 8 / 6 Total / 100 (maximum is 102) 1. Are you in CS101 or

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2018 Miniassignment 1 40 points Due Date: Friday, October 12, 11:59 pm (midnight) Late deadline (25% penalty): Monday, October 15, 11:59 pm General information This assignment is to be done

More information

Assignment3 CS206 Intro to Data Structures Fall Part 1 (50 pts) due: October 13, :59pm Part 2 (150 pts) due: October 20, :59pm

Assignment3 CS206 Intro to Data Structures Fall Part 1 (50 pts) due: October 13, :59pm Part 2 (150 pts) due: October 20, :59pm Part 1 (50 pts) due: October 13, 2013 11:59pm Part 2 (150 pts) due: October 20, 2013 11:59pm Important Notes This assignment is to be done on your own. If you need help, see the instructor or TA. Please

More information

CSCI315 Database Design and Implementation Singapore Assignment 2 11 January 2018

CSCI315 Database Design and Implementation Singapore Assignment 2 11 January 2018 School of Computer Science & Software Engineering Session: 1, January 2017 University of Wollongong Lecturer: Janusz R. Getta CSCI315 Database Design and Implementation Singapore 2018-1 Assignment 2 11

More information

Object Oriented Programming (II)

Object Oriented Programming (II) Islamic University of Gaza Faculty of Engineering Computer Engineering Department Computer Programming Lab (ECOM 2114) Created by Eng: Mohammed Alokshiya Modified by Eng: Mohammed Abdualal Lab 11 Object

More information

Assessment details for All students Assessment item 1

Assessment details for All students Assessment item 1 Assessment details for All students Assessment item 1 Due Date: Weighing: 20% Thursday of Week 6 (19 th April) 11.45 pm AEST 1. Objectives The purpose of this assessment item is to assess your skills attributable

More information

Object-Oriented Programming in Java. Topic : Objects and Classes (cont) Object Oriented Design

Object-Oriented Programming in Java. Topic : Objects and Classes (cont) Object Oriented Design Electrical and Computer Engineering Object-Oriented in Java Topic : Objects and Classes (cont) Object Oriented Maj Joel Young Joel.Young@afit.edu 11-Sep-03 Maj Joel Young Using Class Instances Accessing

More information

Data Structures. Data structures. Data structures. What is a data structure? Simple answer: a collection of data equipped with some operations.

Data Structures. Data structures. Data structures. What is a data structure? Simple answer: a collection of data equipped with some operations. Data Structures 1 Data structures What is a data structure? Simple answer: a collection of data equipped with some operations. Examples Lists Strings... 2 Data structures In this course, we will learn

More information

CS 2210a Data Structures and Algorithms Assignment 5 Solving a Labyrinth Due Date: December 6, 11:59 pm Total marks: 20

CS 2210a Data Structures and Algorithms Assignment 5 Solving a Labyrinth Due Date: December 6, 11:59 pm Total marks: 20 CS 2210a Data Structures and Algorithms Assignment 5 Solving a Labyrinth Due Date: December 6, 11:59 pm Total marks: 20 1 Overview For this assignment you will write a program for finding an exit to a

More information

CSCI 1301: Introduction to Computing and Programming Spring 2019 Lab 10 Classes and Methods

CSCI 1301: Introduction to Computing and Programming Spring 2019 Lab 10 Classes and Methods Note: No Brainstorm this week. This lab gives fairly detailed instructions on how to complete the assignment. The purpose is to get more practice with OOP. Introduction This lab introduces you to additional

More information

Object-Oriented Programming (OOP) Basics. CSCI 161 Introduction to Programming I

Object-Oriented Programming (OOP) Basics. CSCI 161 Introduction to Programming I Object-Oriented Programming (OOP) Basics CSCI 161 Introduction to Programming I Overview Chapter 8 in the textbook Building Java Programs, by Reges & Stepp. Review of OOP History and Terms Discussion of

More information

Fall CS 101: Test 2 Name UVA ID. Grading. Page 1 / 4. Page3 / 20. Page 4 / 13. Page 5 / 10. Page 6 / 26. Page 7 / 17.

Fall CS 101: Test 2 Name UVA  ID. Grading. Page 1 / 4. Page3 / 20. Page 4 / 13. Page 5 / 10. Page 6 / 26. Page 7 / 17. Grading Page 1 / 4 Page3 / 20 Page 4 / 13 Page 5 / 10 Page 6 / 26 Page 7 / 17 Page 8 / 10 Total / 100 1. (4 points) What is your course section? CS 101 CS 101E Pledged Page 1 of 8 Pledged The following

More information

CPSC 233: Assignment 4 (Due March 26 at 4 PM)

CPSC 233: Assignment 4 (Due March 26 at 4 PM) CPSC 233: Assignment 4 (Due March 26 at 4 PM) New learning concepts: Problem solving using object-oriented programming. Aside from main() you cannot implement other static methods. Also you should not

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Spring 2018 Miniassignment 1 40 points Due Date: Thursday, March 8, 11:59 pm (midnight) Late deadline (25% penalty): Friday, March 9, 11:59 pm General information This assignment is to be done

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 7: Construction of a Simulated Cash Register and a Student Class 28 February 2019 SP1-Lab7-2018-19.ppt Tobi Brodie (Tobi@dcs.bbk.ac.uk) 1 Coursework Plagiarism Plagiarism

More information

Programming Assignment 2 ( 100 Points )

Programming Assignment 2 ( 100 Points ) Programming Assignment 2 ( 100 Points ) Due: Thursday, October 16 by 11:59pm This assignment has two programs: one a Java application that reads user input from the command line (TwoLargest) and one a

More information

CMSC 201 Fall 2016 Homework 6 Functions

CMSC 201 Fall 2016 Homework 6 Functions CMSC 201 Fall 2016 Homework 6 Functions Assignment: Homework 6 Functions Due Date: Wednesday, October 26th, 2016 by 8:59:59 PM Value: 40 points Collaboration: For Homework 6, collaboration is not allowed

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #13: Java OO cont d. Janak J Parekh janak@cs.columbia.edu Administrivia Homework due next week Problem #2 revisited Constructors, revisited Remember: a

More information

Part 1: Group Brainstorm (NO computers during this time) Part 2: Submit Individual Brainstorm (You can now use a computer)

Part 1: Group Brainstorm (NO computers during this time) Part 2: Submit Individual Brainstorm (You can now use a computer) Part 1: Group Brainstorm (NO computers during this time) Good programmers think before they begin coding. Part I of this assignment involves brainstorming with a group of peers with absolutely no computers

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be

More information

Assignments 3 & 4. COMP248/Winter Assignment 3 & 4 Page 1 of 7

Assignments 3 & 4. COMP248/Winter Assignment 3 & 4 Page 1 of 7 Concordia University Comp 248 Winter 2016 Introduction to Programming Combined Assignments 3 & 4 - Due by 11:59 PM Sunday March 20, 2016 Assignments 3 & 4 Purpose: The purpose of these assignments is to

More information

CS 2704 Project 3 Spring 2000

CS 2704 Project 3 Spring 2000 Maze Crawler For this project, you will be designing and then implementing a prototype for a simple game. The moves in the game will be specified by a list of commands given in a text input file. There

More information

CS1083 Week 2: Arrays, ArrayList

CS1083 Week 2: Arrays, ArrayList CS1083 Week 2: Arrays, ArrayList mostly review David Bremner 2018-01-08 Arrays (1D) Declaring and using 2D Arrays 2D Array Example ArrayList and Generics Multiple references to an array d o u b l e prices

More information

CS2 Practical 1 CS2A 22/09/2004

CS2 Practical 1 CS2A 22/09/2004 CS2 Practical 1 Basic Java Programming The purpose of this practical is to re-enforce your Java programming abilities. The practical is based on material covered in CS1. It consists of ten simple programming

More information

CS161: Introduction to Computer Science Homework Assignment 10 Due: Monday 11/28 by 11:59pm

CS161: Introduction to Computer Science Homework Assignment 10 Due: Monday 11/28 by 11:59pm CS161: Introduction to Computer Science Homework Assignment 10 Due: Monday 11/28 by 11:59pm Many cable packages come with a search interface that let s you search for a show or movie by typing the name

More information

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE Program 10: 40 points: Due Tuesday, May 12, 2015 : 11:59 p.m. ************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE *************

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 80 points Due Date: Friday, February 2, 11:59 pm (midnight) Late deadline (25% penalty): Monday, February 5, 11:59 pm General information This assignment is to be done

More information

Claremont McKenna College Computer Science

Claremont McKenna College Computer Science Claremont McKenna College Computer Science CS 51 Handout 4: Problem Set 4 February 10, 2011 This problem set is due 11:50pm on Wednesday, February 16. As usual, you may hand in yours until I make my solutions

More information

CSCI 1301: Introduction to Computing and Programming Summer 2018 Lab 07 Classes and Methods

CSCI 1301: Introduction to Computing and Programming Summer 2018 Lab 07 Classes and Methods Introduction This lab introduces you to additional concepts of Object Oriented Programming (OOP), arguably the dominant programming paradigm in use today. In the paradigm, a program consists of component

More information

Programming Assignment 2

Programming Assignment 2 CS 122 Fall, 2004 Programming Assignment 2 New Mexico Tech Department of Computer Science Programming Assignment 2 CS122 Algorithms and Data Structures Due 11:00AM, Wednesday, October 13th, 2004 Objectives:

More information

Announcements for the Class

Announcements for the Class Lecture 2 Classes Announcements for the Class Readings Section 1.4, 1.5 in text Section 3.1 in text Optional: PLive CD that comes with text References in text Assignment Assignment 1 due next week Due

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 7: Construction of a Simulated Cash Register and a Student Class 22 February 2018 SP1-Lab7-2018.ppt Tobi Brodie (Tobi@dcs.bbk.ac.uk) 1 Coursework Plagiarism Plagiarism is

More information

CS 134 Programming Exercise 9:

CS 134 Programming Exercise 9: CS 134 Programming Exercise 9: Nibbles Objective: To gain experience working with 2 dimensional arrays. The Problem Nibbles is a snake. Nibbles moves around a field, looking for food. Unfortunately, Nibbles

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2017 Assignment 1 80 points Due Date: Thursday, February 2, 11:59 pm (midnight) Late deadline (25% penalty): Friday, February 3, 11:59 pm General information This assignment is to be done

More information

COMP 250 Winter 2011 Reading: Java background January 5, 2011

COMP 250 Winter 2011 Reading: Java background January 5, 2011 Almost all of you have taken COMP 202 or equivalent, so I am assuming that you are familiar with the basic techniques and definitions of Java covered in that course. Those of you who have not taken a COMP

More information

Concur Getting Started QuickStart Guide. Concur Technologies Version 1.2

Concur Getting Started QuickStart Guide. Concur Technologies Version 1.2 Concur Technologies Version 1.2 May 12, 2016 Page 1 Document Revision History Date Description Version Author 05/12/2016 converted to new template 1.2 Concur Proprietary Statement These documents contain

More information

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus Northeastern Illinois University CS 200, Section 1, Programming I, Fall 2017 Syllabus, Page 1 of 7 CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus COURSE INFORMATION: Credit

More information

Concur Getting Started QuickStart Guide. Concur Technologies Version 1.3

Concur Getting Started QuickStart Guide. Concur Technologies Version 1.3 Concur Technologies Version 1.3 January 23, 2017 Page 1 Document Revision History Date Description Version Author 05/12/2016 11/30/2016 converted to new template updated proprietary statement 1.2 Concur

More information

CS2 Practical 2 CS2Ah

CS2 Practical 2 CS2Ah CS2 Practical 2 Finite automata This practical is based on material in the language processing thread. The practical is made up of two parts. Part A consists of four paper and pencil exercises, designed

More information

EECS168 Exam 3 Review

EECS168 Exam 3 Review EECS168 Exam 3 Review Exam 3 Time: 2pm-2:50pm Monday Nov 5 Closed book, closed notes. Calculators or other electronic devices are not permitted or required. If you are unable to attend an exam for any

More information

Regis University CC&IS CS362 Data Structures

Regis University CC&IS CS362 Data Structures Regis University CC&IS CS362 Data Structures Programming Assignment #5 (covers classes and objects) Due: midnight Sunday of week 6 A college wants to you to write a test program for tracking their course

More information

Lecture 13 & 14. Single Dimensional Arrays. Dr. Martin O Connor CA166

Lecture 13 & 14. Single Dimensional Arrays. Dr. Martin O Connor CA166 Lecture 13 & 14 Single Dimensional Arrays Dr. Martin O Connor CA166 www.computing.dcu.ie/~moconnor Table of Contents Declaring and Instantiating Arrays Accessing Array Elements Writing Methods that Process

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2017 Miniassignment 1 50 points Due Date: Monday, October 16, 11:59 pm (midnight) Late deadline (25% penalty): Tuesday, October 17, 11:59 pm General information This assignment is to be

More information

CIT 590 Homework 6 Fractions

CIT 590 Homework 6 Fractions CIT 590 Homework 6 Fractions Purposes of this assignment: Get you started in Java and Eclipse Get you comfortable using objects in Java Start looking at some common object uses in Java. General Idea of

More information

Project 1. Java Control Structures 1/17/2014. Project 1 and Java Intro. Project 1 (2) To familiarize with

Project 1. Java Control Structures 1/17/2014. Project 1 and Java Intro. Project 1 (2) To familiarize with Project 1 and Java Intro Sharma Chakravarthy Information Technology Laboratory (IT Lab) Computer Science and Engineering Department The University of Texas at Arlington, Arlington, TX 76019 Email: sharma@cse.uta.edu

More information

COMP 401 Midterm. Tuesday, Oct 18, pm-3:15pm. Instructions

COMP 401 Midterm. Tuesday, Oct 18, pm-3:15pm. Instructions COMP 401 Midterm Tuesday, Oct 18, 2016 2pm-3:15pm Instructions 1. Please spread out and try and sit in alternate seats. 2. This is a closed book exam. 3. You will not be penalized for errors in Java syntax.

More information

Chapter 6 Lab Classes and Objects

Chapter 6 Lab Classes and Objects Gaddis_516907_Java 4/10/07 2:10 PM Page 51 Chapter 6 Lab Classes and Objects Objectives Be able to declare a new class Be able to write a constructor Be able to write instance methods that return a value

More information

(a) Write the signature (visibility, name, parameters, types) of the method(s) required

(a) Write the signature (visibility, name, parameters, types) of the method(s) required 1. (6 pts) Is the final comprehensive? 1 2. (6 pts) Java has interfaces Comparable and Comparator. As discussed in class, what is the main advantage of Comparator? 3. (6 pts) We can use a comparator in

More information

Computer Engineering Department COM 102 OBJECT ORIENTED PROGRAMMING POSTLAB #5

Computer Engineering Department COM 102 OBJECT ORIENTED PROGRAMMING POSTLAB #5 Faculty of Engineering and Architecture Computer Engineering Department COM 102 OBJECT ORIENTED PROGRAMMING POSTLAB #5 Academic Year: Spring 2016 Due Date and Hour: April 26, 2016 - Tuesday, 11.59pm (Submission)

More information

Booking vacation packages (general)

Booking vacation packages (general) Outrigger Hotels and Resorts Vacations FAQs: Booking vacation packages (general) Am I booking my vacation package directly with Outrigger Hotels and Resorts? No, your booking is handled through Global

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

CSE115 Lab 4 Fall 2016

CSE115 Lab 4 Fall 2016 DUE DATES: Monday recitations: 9:00 PM on 10/09 Wednesday recitations: 9:00 PM on 10/11 Thursday recitations: 9:00 PM on 10/12 Friday recitations: 9:00 PM on 10/13 Saturday recitations: 9:00 PM on 10/14

More information

Arrays. Eng. Mohammed Abdualal

Arrays. Eng. Mohammed Abdualal Islamic University of Gaza Faculty of Engineering Computer Engineering Department Computer Programming Lab (ECOM 2114) Created by Eng: Mohammed Alokshiya Modified by Eng: Mohammed Abdualal Lab 9 Arrays

More information

CSE 131 Introduction to Computer Science Fall Exam II

CSE 131 Introduction to Computer Science Fall Exam II CSE 131 Introduction to Computer Science Fall 2013 Given: 6 November 2013 Exam II Due: End of session This exam is closed-book, closed-notes, no electronic devices allowed. The exception is the cheat sheet

More information

CS 101 Fall 2006 Midterm 3 Name: ID:

CS 101 Fall 2006 Midterm 3 Name:  ID: You only need to write your name and e-mail ID on the first page. This exam is CLOSED text book, closed-notes, closed-calculator, closed-neighbor, etc. Questions are worth different amounts, so be sure

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 March 18, 2016 The Java ASM What is the value of ans at the end of this program? Counter[] a = { new Counter(), new Counter() ; Counter[] b = {

More information

Our second exam is Monday, April 3. Note that it will not be possible to get all the homework submissions graded before the exam.

Our second exam is Monday, April 3. Note that it will not be possible to get all the homework submissions graded before the exam. Com S 227 Spring 2017 Assignment 3 300 points Due Date:, Wednesday, March 29 11:59 pm (midnight) Late deadline (25% penalty): Thursday, March 30, 11:59 pm General information This assignment is to be done

More information

Important Project Dates

Important Project Dates Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2002 Handout 4 Project Overview Wednesday, September 4 This is an overview of the course project

More information

Assignment 5: MyString COP3330 Fall 2017

Assignment 5: MyString COP3330 Fall 2017 Assignment 5: MyString COP3330 Fall 2017 Due: Wednesday, November 15, 2017 at 11:59 PM Objective This assignment will provide experience in managing dynamic memory allocation inside a class as well as

More information

CS2110 Assignment 2 Lists, Induction, Recursion and Parsing, Summer

CS2110 Assignment 2 Lists, Induction, Recursion and Parsing, Summer CS2110 Assignment 2 Lists, Induction, Recursion and Parsing, Summer 2008 Due Thursday July 3, 2008, 6:00PM 0 General Instructions 0.1 Purpose This assignment will help you solidify your knowledge of Java

More information

Faculty of Science COMP-202B - Introduction to Computing I (Winter 2009) Midterm Examination

Faculty of Science COMP-202B - Introduction to Computing I (Winter 2009) Midterm Examination First Name: Last Name: McGill ID: Section: Faculty of Science COMP-202B - Introduction to Computing I (Winter 2009) Midterm Examination Monday, March 9, 2009 Examiners: Mathieu Petitpas [Section 1] 18:30

More information

Assignment 3: Distance COP3330 Fall 2017

Assignment 3: Distance COP3330 Fall 2017 Assignment 3: Distance COP3330 Fall 2017 Due: Monday, October 16, 2017 at 11:59 PM Objective This assignment will provide experience with basic operator overloading. Task Your task will be to create a

More information

CT 229 Fundamentals of Java Syntax

CT 229 Fundamentals of Java Syntax CT 229 Fundamentals of Java Syntax 19/09/2006 CT229 New Lab Assignment Monday 18 th Sept -> New Lab Assignment on CT 229 Website Two Weeks for Completion Due Date is Oct 1 st Assignment Submission is online

More information

Welcome to CompSci 201

Welcome to CompSci 201 Welcome to CompSci 201 Data Structures and Algorithms Go to the class webpage http://www.cs.duke.edu/courses/compsci201/ fall13/wordpress/ Start looking around 1 Welcome Prof. Peck Ben Reem An army of

More information

CS 463 Project 1 Imperative/OOP Fractals

CS 463 Project 1 Imperative/OOP Fractals CS 463 Project 1 Imperative/OOP Fractals The goal of a couple of our projects is to compare a simple project across different programming paradigms. This semester, we will calculate the Mandelbrot Set

More information

Introduction to Programming COIT 20245

Introduction to Programming COIT 20245 Introduction to Programming COIT 20245 Assessment item 1 Java Console Program Due date: Weighting: Length: Week 7 T318 24 December 2018 Refer below for complete assessment item 1 requirements (Assignment

More information

a) Answer all questions. b) Write your answers in the space provided. c) Show all calculations where applicable.

a) Answer all questions. b) Write your answers in the space provided. c) Show all calculations where applicable. Name: Please fill in your Student Number and Name. Student Number : Student Number: University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ 2008 January Exam Question Max Internal

More information

Australian Informatics Olympiad Thursday 23 August, Information Booklet

Australian Informatics Olympiad Thursday 23 August, Information Booklet Australian Informatics Olympiad Thursday 23 August, 2018 Information Booklet Information for Teachers and Students Contest Rules Why Did I Score Zero? Please read this booklet before the day of the contest

More information

Recommended Group Brainstorm (NO computers during this time)

Recommended Group Brainstorm (NO computers during this time) Recommended Group Brainstorm (NO computers during this time) Good programmers think before they begin coding. Part I of this assignment involves brainstorming with a group of peers with no computers to

More information

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time)

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) CSE 11 Winter 2017 Program Assignment #2 (100 points) START EARLY! Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) PROGRAM #2: DoubleArray11 READ THE ENTIRE ASSIGNMENT BEFORE STARTING In lecture,

More information

EECE.2160: ECE Application Programming

EECE.2160: ECE Application Programming Fall 2017 Programming Assignment #10: Doubly-Linked Lists Due Monday, 12/18/17, 11:59:59 PM (Extra credit ( 5 pts on final average), no late submissions or resubmissions) 1. Introduction This assignment

More information

AL GHURAIR UNIVERSITY College of Computing. Objectives: Examples: if Single-Selection Statement CSC 209 JAVA I. week 3- Control Statements: Part I

AL GHURAIR UNIVERSITY College of Computing. Objectives: Examples: if Single-Selection Statement CSC 209 JAVA I. week 3- Control Statements: Part I AL GHURAIR UNIVERSITY College of Computing CSC 209 JAVA I week 3- Control Statements: Part I Objectives: To use the if and if...else selection statements to choose among alternative actions. To use the

More information

CS61BL: Data Structures & Programming Methodology Summer Project 1: Dots!

CS61BL: Data Structures & Programming Methodology Summer Project 1: Dots! CS61BL: Data Structures & Programming Methodology Summer 2014 Project 1: Dots! Note on compiling Board.java You will not be able to compile Board.java until you make your own CantRemoveException class.

More information

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists Regis University CC&IS CS310 Data Structures Programming Assignment 2 Arrays and ArrayLists Problem Scenario The real estate office was very impressed with your work from last week. The IT director now

More information

This project is worth 600 points Due on April 17 Pick one from the following project to create complete running program with documentation

This project is worth 600 points Due on April 17 Pick one from the following project to create complete running program with documentation This project is worth 600 points Due on April 17 Pick one from the following project to create complete running program with documentation 1. Product Inventory Project Create an application which manages

More information

Name: Checked: Access the Java API at the link above. Why is it abbreviated to Java SE (what does the SE stand for)?

Name: Checked: Access the Java API at the link above. Why is it abbreviated to Java SE (what does the SE stand for)? Lab 5 Name: Checked: Objectives: Learn about the Java API Practice using Math, Random, String, and other classes from the Java API Practice writing code to do basic String processing Preparation: Complete

More information

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects Administrative Stuff September 12, 2007 HW3 is due on Friday No new HW will be out this week Next Tuesday we will have Midterm 1: Sep 18 @ 6:30 7:45pm. Location: Curtiss Hall 127 (classroom) On Monday

More information

Computer Based Testing (CBT) Information

Computer Based Testing (CBT) Information Computer Based Testing (CBT) Information The Pennsylvania Board of Law Examiners Please read this informational brochure carefully! DO NOT bring this brochure with you to the examination room. You will

More information

Extegrity Exam4 Take Home Exam Guide

Extegrity Exam4 Take Home Exam Guide Extegrity Exam4 Take Home Exam Guide IMPORTANT NOTE: While students may complete a take-home exam any time during the designated time as set by each faculty member, technology support is only available

More information

Assignment 1 due Monday at 11:59pm

Assignment 1 due Monday at 11:59pm Assignment 1 due Monday at 11:59pm The heart of Object-Oriented Programming (Now it gets interesting!) Reading for next lecture is Ch. 7 Focus on 7.1, 7.2, and 7.6 Read the rest of Ch. 7 for class after

More information

CONCORDIA UNIVERSITY Summer 2005 Comp 248 /1 Section AA Introduction to Programming Final Examination/A

CONCORDIA UNIVERSITY Summer 2005 Comp 248 /1 Section AA Introduction to Programming Final Examination/A NAME: ID: CONCORDIA UNIVERSITY Summer 2005 Comp 248 /1 Section AA Introduction to Programming Final Examination/A Instructor: N. Acemian Monday June 27, 2005 Duration: 3 hours INSTRUCTIONS: - Answer all

More information

Computer Science E-119 Fall Problem Set 1. Due before lecture on Wednesday, September 26

Computer Science E-119 Fall Problem Set 1. Due before lecture on Wednesday, September 26 Due before lecture on Wednesday, September 26 Getting Started Before starting this assignment, make sure that you have completed Problem Set 0, which can be found on the assignments page of the course

More information

CS/ENGRD 2110 SPRING Lecture 4: The class hierarchy; static components

CS/ENGRD 2110 SPRING Lecture 4: The class hierarchy; static components 1 CS/ENGRD 2110 SPRING 2014 Lecture 4: The class hierarchy; static components http://courses.cs.cornell.edu/cs2110 2 Klaatu barada nikto We are recruiting developers for the Fall semester.! We will also

More information