Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Size: px
Start display at page:

Download "Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written."

Transcription

1 QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, FALL TERM, 2013 FINAL EXAMINATION 7pm to 10pm, 18 DECEMBER 2013 Instructor: Alan McLeod If the instructor is unavailable in the examination room and if doubt exists as to the interpretation of any problem, the candidate is urged to submit with the answer paper a clear statement of any assumptions made. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Please write your answers in the boxes provided. Extra space is available on the last page of the exam. The back of any page can be used for rough work. This exam is three hours long and refers exclusively to the use of the Java language. Comments are not required in the code you write. For full marks, code must be efficient as well as correct. This is a closed book exam. No computers or calculators are allowed. Student Number: Problem 1: / 20 Problem 4: / 15 Problem 2: / 20 Problem 5: / 10 Problem 3: / 25 TOTAL: / 90 This material is copyrighted and is for the sole use of students registered in CISC124 and writing this exam. This material shall not be distributed or disseminated. Failure to abide by these conditions is a breach of copyright and may also constitute a breach of academic integrity under the University Senate's Academic Integrity Policy Statement.

2 Student Number: Page 2 of 20 Problem 1) [20 marks]: Concepts Answer the following questions as briefly as possible: List all five integer primitive types in Java: Name the four types of loops available in Java: What is the difference between what a continue statement does and what a break statement does in the context of loops? What is the difference between a mutable and an immutable object? Give an example of each using types already defined in Java. How do you overload methods in Java?

3 Student Number: Page 3 of 20 Problem 1, Cont.) What should a method do if it cannot carry out its task with the arguments supplied to it? What is a privacy leak in the context of encapsulation? Why is it better to use a generic method instead of a method typed to use the Object class? How does a modal window behave compared to a modeless window? How many bits are required to specify a Color that contains a transparency level (or an alpha value)?

4 Student Number: Page 4 of 20 Problem 2) [20 marks]: Fundamental Java Here is a reminder of some Java API syntax that may be useful in this problem: The Files class has the static methods:.newbufferedreader(path_object, charset_object) which returns a BufferedReader object that should be used as a resource in a Java 7 try-with-resources block..newbufferedwriter(path_object, charset_object) which returns a BufferedWriter object to be used as a resource in a Java 7 try-with-resources block..readalllines(path_object, charset_object) which returns a List<String> object consisting of the entire file contents. A List<String> object can be cast to an ArrayList<String> object. The BufferedReader class has the method:.readline() which returns a line from a text file as a String. The next invocation of this method moves to the next line of the file. The method returns null if it reaches the end of the file. The BuffereWriter class has the void return method:.write(line_of_text) which writes the line of text supplied as a String to a file. All of the methods listed above can throw an IOException which must be caught. If an IOException is caught, just display an error message to the console and exit the method. An ArrayList<> object has the methods:.size() returns the number of elements in the collection..get(index) returns the element at location index..add(element) adds the element to the end of the collection. A Charset object is created using: Charset charset = Charset.forName("US ASCII"); A Path object is returned by the code Paths.get(filename), where filename is the name of a file as a String. One constructor of a StringTokenizer object accepts a String to be tokenized and another String representing the delimiters to be used to tokenize the supplied String. The StringTokenizer class has the methods:.counttokens() returns the number of tokens contained in an instance of a StringTokenizer object..nexttoken() - returns the next token from a StringTokenizer object as a String, removing that token from the object..hasmoretokens() returns true if there are still one or more tokens remaining in the StringTokenizer object.

5 Student Number: Page 5 of 20 The Double class has the static method:.parsedouble(a_num) which returns a double obtained from converting the String a_num to a double value. The method throws a NumberFormatException if the String cannot be converted, but you can invoke the method without having to catch this exception. The String class has the methods:.indexof(a_char) returns the position of the first occurrence of a_char in the String. If a_char is not found 1 is returned..indexof(a_char, pos) returns the position of a_char searching from position pos..substring(pos) returns the substring starting at position pos and going to the end of the String..substring(pos1, pos2) returns the substring starting from pos1 and going to (pos2 1)..trim() returns a string where leading and trailing whitespace has been removed. You will need to use many, but probably not all of the methods listed above in this problem. To complete the problem you need to write four methods to be used in a program that reads a text file containing comma-delimited data in rows and columns, creates a 2D array of double out of that data, rotates the data (rows become columns, columns become rows) and then writes the data to another text file. For example, if you have a file Data.csv that contains: 2.36,3.04,0.17,0.13,0.04,0.02, ,2.77,0.15,0.12,0.03,0.02, ,2.96,0.12,0.12,0.04,0.01, ,2.94,0.19,0.11,0.03,0.02, ,2.75,0.12,0.08,0.03,0.02, ,2.78,0.14,0.10,0.02,0.02, ,3.00,0.10,0.24,0.03,0.02, ,3.01,0.21,0.15,0.03,0.02, ,2.80,0.23,0.22,0.02,0.01, ,2.62,0.13,0.08,0.03,0.02,6.19 And, if you invoked the methods as shown in this fancy line of code: writedata("dataout.csv", rotatearray(processcontents(readfile("data.csv")))); The file DataOut.csv would contain: 2.36,2.58,2.47,2.49,2.28,2.21,2.52,2.64,2.24, ,2.77,2.96,2.94,2.75,2.78,3.00,3.01,2.80, ,0.15,0.12,0.19,0.12,0.14,0.10,0.21,0.23, ,0.12,0.12,0.11,0.08,0.10,0.24,0.15,0.22, ,0.03,0.04,0.03,0.03,0.02,0.03,0.03,0.02, ,0.02,0.01,0.02,0.02,0.02,0.02,0.02,0.01, ,6.28,6.82,6.13,6.31,6.83,6.45,6.86,6.45,6.19

6 Student Number: Page 6 of 20 So, you need to write four complete methods: readfile accepts a String filename as a parameter and returns the contents of that file as an ArrayList<String>. processcontents accepts an ArrayList<String> object as a parameter and returns a 2D array of double with the same row, column structure as the data in the file. rotatearray accepts a 2D array of double as a parameter and turns it 90 degrees clockwise, so that the rows are now columns and the columns are now rows, returning this array. writedata accepts a 2D array of double as well as a String filename as parameters and then saves the data in comma-delimited format to the text file. Do not write any other methods than these four, and do not assume the existence of any class attributes. Your methods must work for any number of rows and columns of data. You may assume: The file will always contain at least two rows and two columns of data. The input file will always exist and you will always have read and write privilege for the files. The filename will always contain whatever path information is required to locate the file, and will never be null or empty. The data will always be in the comma-delimited text format shown in the above example. Each line in the file will have the same format, the same number of numbers and there will not be any empty lines. Each individual number string (a token ) will convert properly to a double value. You need to retain every digit in the double value. Please write the methods in the order given above starting below and continuing onto the next two pages, as needed.

7 Student Number: Page 7 of 20 Problem 2, Cont.)

8 Student Number: Page 8 of 20 Problem 2, Cont.)

9 Student Number: Page 9 of 20 Problem 3) [25 marks]: Encapsulation For this problem you need to build a few classes that are going to be used in a graphical plotting program. The longest class is called Digitized. The purpose of this class is to create and store an array of pixel coordinates for a mathematical equation which eventually will be rendered as a curve in a panel in a GUI. The single constructor for Digitized takes three parameters: An instance of a class that implements the Equation interface. The width of the panel in pixels that must lie between 80 and 800 pixels. The height of the panel in pixels that must lie between 80 and 800 pixels. This constructor must throw an instance of an exception class called IllegalPanel if either of the panel dimensions is not legal, with an appropriate message. You do not have to carry out any checks on the Equation object. The class must have a single mutator that accepts both the width and the height of the panel. The mutator must also throw an exception if either of the supplied dimensions are not legal. When a Digitized object is instantiated or modified it must calculate and store an array of Point objects, where each Point is a pixel coordinate pair that corresponds to the points generated by the supplied equation for the supplied bounds. The Digitized class must have an accessor for this array of Points that will prevent any privacy leaks. You will need to generate a Point for every pixel in the horizontal direction of the panel. For example if the panel width is 400 pixels your array of Points will be of size 400. The last method required for the Digitized class is a tostring() method that returns a listing of every twentieth point in the array for debugging purposes. An example of this output will be provided below. To be clear your Digitized class does not plot or draw anything, it just generates and stores the array of Points that will eventually be used by some GUI plotting program that you don t need to write! As you will remember from assignment 4, graphics drawing requires pixel coordinates, so you must scale real (x, y) coordinates to pixel coordinates so that they can be used without further conversion for eventual drawing to the panel. This is the purpose of the Digitized class. Here is the Equation interface: public interface Equation { double getxmin(); double getxmax(); double getymin(); double getymax(); double evaluate(double x); // end Equation interface

10 Student Number: Page 10 of 20 Here is a class called Parabola that implements the Equation interface: public class Parabola implements Equation { public double getxmin() { return 0; public double getxmax() { return 5; public double getymin() { return evaluate(0); public double getymax() { return evaluate(5); public double evaluate (double x) { return 2 * x * x; // end Parabola class As you can see this equation is y = 2x 2 and it is defined for 0 x 5. For example, consider an instance of the Digitized class which is created with an instance of this Parabola object and 400 for both the panel width and the panel height. If this instance of the Digitized class is printed to the console (using the tostring() method) it would display: Every 20th point: (0, 400) (20, 399) (40, 396) (60, 391) (80, 384) (100, 375) (120, 364) (140, 351) (160, 336) (180, 319) (200, 300) (220, 279) (240, 256) (260, 231) (280, 204) (300, 175) (320, 144) (340, 111) (360, 76) (380, 39) These Points consist of pixel positions as in (horizontal, vertical). If this was plotted on the screen the lower, left corner of the panel would correspond to the (0, 0) position in real coordinates and the top, right corner of the panel would correspond to the (5, 50) position in real coordinates. The Digitized class will need two other supporting classes that you also have to write. The shortest one is the Exception class called IllegalPanel. You must also write the Point class that will be used by Digitized.

11 Student Number: Page 11 of 20 The purpose of the Point class is to store two int type pixel coordinates. The constructor of Point takes two int values, the x value and the y value in screen coordinates. No checks on these values are needed, so the constructor of Point will not throw an exception. You will need accessors and mutators for both x and y values. Write a clone method for Point, as well as a tostring() method that shows a point as it appears as a single line from the sample output shown on the previous page ( (160, 336), for example). Finally you must write an equals method for the Point class that overrides the equals method inherited from the base Object class. You won t need this equals() method in Digitized so the purpose of this method is just to demonstrate that you know how to write a proper equals() method! Equality for a Point object is defined as both x and y values being exactly equal. You can now see that the underlying data structure used in Digitized will be typed as Point[]. This will also be the return type for the accessor in Digitized. Write the IllegalPanel class below:

12 Student Number: Page 12 of 20 Problem 3, Cont.) Write the Point class here:

13 Student Number: Page 13 of 20 Problem 3, Cont.) Write the Digitized class here and continue on the next page:

14 Student Number: Page 14 of 20 Problem 3, Cont.)

15 Student Number: Page 15 of 20 Problem 4) [15 marks]: Inheritance Here are three classes that compile without error: public abstract class ClassEh { public String methodone(string one) { return "unladen " + one; public abstract void methodtwo(string one); // end ClassEh public class ClassBee extends ClassEh { public String methodone(string one, String two) { return one + two; public void methodtwo(string one) { System.out.println(one); public int methodthree (String one) { return one.length(); // end ClassBee public class ClassSea extends ClassBee { public String methodone(string one, String two, String three) { return one + two + three; public String methodone(string one) { return "giant " + one; public void methodtwo(string one) { super.methodtwo(one); System.out.println("swallow"); // end ClassSea

16 Student Number: Page 16 of 20 Problem 4, Cont.) Here is a main method from another class that uses the hierarchy listed above. It has 15 method calls (not counting constructors), but four of them will not compile. Write error beside these four and provide the output of the other 11: public static void main(string[] args) { ClassSea sea = new ClassSea(); System.out.println(sea.methodOne("swallow")); System.out.println(sea.methodOne("fuzzy ", "bunny")); System.out.println(sea.methodOne("giant ", "fuzzy ", "bunny")); sea.methodtwo("laden"); System.out.println(sea.methodThree("laden swallow")); ClassBee seadoo = new ClassSea(); System.out.println(seaDoo.methodOne("giant ", "green ", "bunny")); System.out.println(seaDoo.methodOne("swallow")); System.out.println(seaDoo.methodOne("green ", "banana")); seadoo.methodtwo("laden ", "swallow"); ClassEh seabreeze = new ClassSea(); System.out.println(seaBreeze.methodOne("mouse")); seabreeze.methodtwo("feathered"); System.out.println(seaBreeze.methodThree("fuzzy")); ClassEh beejam = new ClassBee(); System.out.println(beeJam.methodOne("camel")); beejam.methodtwo("fuzzy camel"); ClassEh ehwhat = new ClassEh(); System.out.println(ehWhat.methodOne("elephant")); // end main

17 Student Number: Page 17 of 20 Problem 5) [10 marks]: GUI Construction The following complete GUI program sprawls over this page and the next and runs without error: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Problem5 extends JFrame { private Box box1; private MyPanel panel; private boolean panelflag = false; private JButton leftbutton; private JButton rightbutton; public Problem5() { super(); int i; setdefaultcloseoperation(jframe.exit_on_close); settitle("problem 5 GUI"); setlocation(200, 200); setsize(600, 500); Font myfont = new Font("Arial", Font.PLAIN, 18); JButton[] group1 = new JButton[4]; box1 = Box.createHorizontalBox(); for (i = 0; i < 4; i++) { group1[i] = new JButton("Button " + i); group1[i].setfont(myfont); box1.add(box.createhorizontalglue()); box1.add(group1[i]); box1.add(box.createhorizontalglue()); JLabel[] group2 = new JLabel[4]; for (i = 0; i < 4; i++) { group2[i] = new JLabel("Label " + i); group2[i].setfont(myfont); group2[i].sethorizontalalignment(swingconstants.center); panel = new MyPanel(); panel.setlayout(new GridLayout(2, 2)); for (i = 0; i < 4; i++) panel.add(group2[i]); JPanel panel2 = new JPanel(new FlowLayout()); leftbutton = new JButton("Left Button"); leftbutton.setfont(myfont); leftbutton.addactionlistener(new ActionListener() {

18 Student Number: Page 18 of 20 public void actionperformed(actionevent e) { panelflag = true; panel.repaint(); ); rightbutton = new JButton("Right Button"); rightbutton.setfont(myfont); panel2.add(leftbutton); panel2.add(rightbutton); add(box1, BorderLayout.NORTH); add(panel, BorderLayout.CENTER); add(panel2, BorderLayout.SOUTH); // end constructor private class MyPanel extends JPanel { public MyPanel() { super(); public void paint(graphics g) { super.paint(g); if (!panelflag) return; leftbutton.setvisible(false); rightbutton.setvisible(false); g.setcolor(color.black); // (left, top, width, height) g.drawrect(100, 80, 400, 300); box1.setvisible(false); // end MyPanel public static void main(string[] args) { Problem5 p5 = new Problem5(); p5.setvisible(true); // end main // end Problem5 class In the empty frame shown at the top of the next page, sketch the window as it first appears. Do not worry about absolute pixel sizes, the shape of the letters or drawing straight lines, just try to get the relative positions of the components correct and show gaps where they exist. Draw a label as just text and a button as text inside a rectangle. Don t worry about colours or shading.

19 Student Number: Page 19 of 20 Draw the window again after the button labelled Left Button has been clicked:

20 Student Number: Page 20 of 20 Extra Page

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, FALL TERM, 2013 FINAL EXAMINATION 7pm to 10pm, 18 DECEMBER 2013 Instructor: Alan McLeod HAND IN Answers Are Recorded on Question Paper SOLUTION If the instructor

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CMPE212, FALL TERM, 2012 FINAL EXAMINATION 18 December 2012, 2pm Instructor: Alan McLeod If the instructor is unavailable

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, WINTER TERM, 2012 FINAL EXAMINATION 9am to 12pm, 26 APRIL 2012 Instructor: Alan McLeod If the instructor is

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Solution HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2010 FINAL EXAMINATION 2pm to 5pm, 19 APRIL 2010, Dunning Hall Instructor: Alan McLeod

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor: Alan

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, WINTER TERM, 2011 FINAL EXAMINATION 7pm to 10pm, 26 APRIL 2011, Ross Gym Instructor: Alan McLeod If the instructor

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod If the

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2005 FINAL EXAMINATION 9am to 12noon, 19 DECEMBER 2005 Instructor: Alan McLeod

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod If the

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2005 FINAL EXAMINATION 9am to 12noon, 19 DECEMBER 2005 Instructor: Alan McLeod If

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Solution HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2009 FINAL EXAMINATION 14 DECEMBER 2009 Instructor: Alan McLeod If the instructor is unavailable

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSIY SCHOOL O COMPUING CMPE212, ALL ERM, 2011 INAL EXAMINAION 15 December 2011, 2pm, Grant Hall Instructor: Alan McLeod HAND IN Answers Are Recorded on Question Paper SOLUION If the instructor

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2008 FINAL EXAMINATION 7pm to 10pm, 17 DECEMBER 2008, Grant Hall Instructor: Alan McLeod

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSIY SCHOOL O COMPUING CISC124, WINER ERM, 2011 INAL EXAMINAION 7pm to 10pm, 26 APRIL 2011, Ross Gym HAND IN Answers Are Recorded on Question Paper SOLUION Instructor: Alan McLeod If the instructor

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Exam Paper CMPE212, WINTER TERM, 2016 FINAL EXAMINATION 9am to 12pm, 19 APRIL 2016 Instructor: Alan McLeod If the instructor is unavailable

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, FALL TERM, 2015 FINAL EXAMINATION 7pm to 10pm, 15 DECEMBER 2015 Instructor: Alan McLeod If the instructor

More information

Queen s University Faculty of Arts and Science School of Computing CISC 124 Final Examination December 2004 Instructor: M. Lamb

Queen s University Faculty of Arts and Science School of Computing CISC 124 Final Examination December 2004 Instructor: M. Lamb Queen s University Faculty of Arts and Science School of Computing CISC 124 Final Examination December 2004 Instructor: M. Lamb HAND IN Answers recorded on Examination paper This examination is THREE HOURS

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2004 FINAL EXAMINATION 9am to 12noon, 22 DECEMBER 2004 Instructors: Alan

More information

Midterm assessment - MAKEUP Fall 2010

Midterm assessment - MAKEUP Fall 2010 M257 MTA Faculty of Computer Studies Information Technology and Computing Date: /1/2011 Duration: 60 minutes 1-Version 1 M 257: Putting Java to Work Midterm assessment - MAKEUP Fall 2010 Student Name:

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2010 FINAL EXAMINATION 11 DECEMBER 2010, 9am SOLUTION HAND IN Answers Are Recorded on Question Paper Instructor: Alan McLeod If the instructor

More information

Final Examination Semester 2 / Year 2012

Final Examination Semester 2 / Year 2012 Final Examination Semester 2 / Year 2012 COURSE : JAVA PROGRAMMING COURSE CODE : PROG1114 TIME : 2 1/2 HOURS DEPARTMENT : COMPUTER SCIENCE LECTURER : LIM PEI GEOK Student s ID : Batch No. : Notes to candidates:

More information

First Name: AITI 2004: Exam 2 July 19, 2004

First Name: AITI 2004: Exam 2 July 19, 2004 First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: JSP Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand

More information

Final Examination Semester 2 / Year 2010

Final Examination Semester 2 / Year 2010 Southern College Kolej Selatan 南方学院 Final Examination Semester 2 / Year 2010 COURSE : JAVA PROGRAMMING COURSE CODE : PROG1114 TIME : 2 1/2 HOURS DEPARTMENT : COMPUTER SCIENCE LECTURER : LIM PEI GEOK Student

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

First Name: AITI 2004: Exam 2 July 19, 2004

First Name: AITI 2004: Exam 2 July 19, 2004 First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: Standard Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Announcements A3 is up, due Friday, Oct 10 Prelim 1 scheduled for Oct 16 if you have a conflict, let us know now 2 Interactive

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2009 FINAL EXAMINATION 14 DECEMBER 2009 SOLUTION Instructor: Alan McLeod If the instructor is unavailable

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

DM503 Programming B. Peter Schneider-Kamp.

DM503 Programming B. Peter Schneider-Kamp. DM503 Programming B Peter Schneider-Kamp petersk@imada.sdu.dk! http://imada.sdu.dk/~petersk/dm503/! ADVANCED OBJECT-ORIENTATION 2 Object-Oriented Design classes often do not exist in isolation from each

More information

Fall 2017 CISC124 10/1/2017

Fall 2017 CISC124 10/1/2017 CISC124 Today First onq quiz this week write in lab. More details in last Wednesday s lecture. Repeated: The quiz availability times will change to match each lab as the week progresses. Useful Java classes:

More information

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks)

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) M257 MTA Spring2010 Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) 1. If we need various objects that are similar in structure, but

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Final Examination Semester 2 / Year 2011

Final Examination Semester 2 / Year 2011 Southern College Kolej Selatan 南方学院 Final Examination Semester 2 / Year 2011 COURSE COURSE CODE TIME DEPARTMENT LECTURER : JAVA PROGRAMMING : PROG1114 : 2 1/2 HOURS : COMPUTER SCIENCE : LIM PEI GEOK Student

More information

Lecture 5: Java Graphics

Lecture 5: Java Graphics Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,

More information

RAIK 183H Examination 2 Solution. November 10, 2014

RAIK 183H Examination 2 Solution. November 10, 2014 RAIK 183H Examination 2 Solution November 10, 2014 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)

More information

CS Exam 1 Review Suggestions

CS Exam 1 Review Suggestions CS 235 - Fall 2015 - Exam 1 Review Suggestions p. 1 last modified: 2015-09-30 CS 235 - Exam 1 Review Suggestions You are responsible for material covered in class sessions, lab exercises, and homeworks;

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSIY SCHOOL O COMPUING HAND IN Answers Are Recorded on Exam Paper CMPE212, WINER ERM, 2016 INAL EXAMINAION 9am to 12pm, 19 APRIL 2016 Instructor: Alan McLeod If the instructor is unavailable

More information

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"

More information

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun! Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques

More information

Java for Non Majors. Final Study Guide. April 26, You will have an opportunity to earn 20 extra credit points.

Java for Non Majors. Final Study Guide. April 26, You will have an opportunity to earn 20 extra credit points. Java for Non Majors Final Study Guide April 26, 2017 The test consists of 1. Multiple choice questions 2. Given code, find the output 3. Code writing questions 4. Code debugging question 5. Short answer

More information

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:

More information

Dr. Hikmat A. M. AbdelJaber

Dr. Hikmat A. M. AbdelJaber Dr. Hikmat A. M. AbdelJaber JWindow: is a window without a title bar or move controls. The program can move and resize it, but the user cannot. It has no border at all. It optionally has a parent JFrame.

More information

Starting Out with Java: From Control Structures Through Objects Sixth Edition

Starting Out with Java: From Control Structures Through Objects Sixth Edition Starting Out with Java: From Control Structures Through Objects Sixth Edition Chapter 12 A First Look at GUI Applications Chapter Topics 12.1 Introduction 12.2 Creating Windows 12.3 Equipping GUI Classes

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSIY SCHOOL O COMPUING CISC124, ALL ERM, 2015 INAL EXAMINAION 7pm to 10pm, 15 DECEMBER 2015 Instructor: Alan McLeod HAND IN Answers Are Recorded on Question Paper SOLUION If the instructor

More information

Window Interfaces Using Swing. Chapter 12

Window Interfaces Using Swing. Chapter 12 Window Interfaces Using Swing 1 Reminders Project 7 due Nov 17 @ 10:30 pm Project 6 grades released: regrades due by next Friday (11-18-2005) at midnight 2 GUIs - Graphical User Interfaces Windowing systems

More information

CS 180 Final Exam Review 12/(11, 12)/08

CS 180 Final Exam Review 12/(11, 12)/08 CS 180 Final Exam Review 12/(11, 12)/08 Announcements Final Exam Thursday, 18 th December, 10:20 am 12:20 pm in PHYS 112 Format 30 multiple choice questions 5 programming questions More stress on topics

More information

Graphics User Defined Forms, Part I

Graphics User Defined Forms, Part I Graphics User Defined Forms, Part I Quick Start Compile step once always mkdir labs javac PropertyTax5.java cd labs mkdir 5 Execute step cd 5 java PropertyTax5 cp /samples/csc/156/labs/5/*. cp PropertyTax1.java

More information

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming

More information

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Course Overview This course teaches programmers the skills necessary to create Java programming system applications and satisfies the

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Come & Join Us at VUSTUDENTS.net

Come & Join Us at VUSTUDENTS.net Come & Join Us at VUSTUDENTS.net For Assignment Solution, GDB, Online Quizzes, Helping Study material, Past Solved Papers, Solved MCQs, Current Papers, E-Books & more. Go to http://www.vustudents.net and

More information

University of Cape Town Department of Computer Science Computer Science CSC1017F

University of Cape Town Department of Computer Science Computer Science CSC1017F First Name: Last Name: Student Number: University of Cape Town Department of Computer Science Computer Science CSC1017F Class Test 4 - Solutions Wednesday, 17 May 2006 Marks: 40 Time: 40 Minutes Approximate

More information

JRadioButton account_type_radio_button2 = new JRadioButton("Current"); ButtonGroup account_type_button_group = new ButtonGroup();

JRadioButton account_type_radio_button2 = new JRadioButton(Current); ButtonGroup account_type_button_group = new ButtonGroup(); Q)Write a program to design an interface containing fields User ID, Password and Account type, and buttons login, cancel, edit by mixing border layout and flow layout. Add events handling to the button

More information

1.00/ Introduction to Computers and Engineering Problem Solving. Quiz 2 / November 5, 2004

1.00/ Introduction to Computers and Engineering Problem Solving. Quiz 2 / November 5, 2004 1.00/1.001 Introduction to Computers and Engineering Problem Solving Quiz 2 / November 5, 2004 Name: Email Address: TA: Section: You have 90 minutes to complete this exam. For coding questions, you do

More information

To gain experience using GUI components and listeners.

To gain experience using GUI components and listeners. Lab 5 Handout 7 CSCI 134: Fall, 2017 TextPlay Objective To gain experience using GUI components and listeners. Note 1: You may work with a partner on this lab. If you do, turn in only one lab with both

More information

Systems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid

Systems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid Systems Programming Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid Leganés, 21st of March, 2014. Duration: 75 min. Full

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Name Section. CS 21a Introduction to Computing I 1 st Semester Final Exam

Name Section. CS 21a Introduction to Computing I 1 st Semester Final Exam CS a Introduction to Computing I st Semester 00-00 Final Exam Write your name on each sheet. I. Multiple Choice. Encircle the letter of the best answer. ( points each) Answer questions and based on the

More information

Java Programming Lecture 6

Java Programming Lecture 6 Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components

More information

JFrame In Swing, a JFrame is similar to a window in your operating system

JFrame In Swing, a JFrame is similar to a window in your operating system JFrame In Swing, a JFrame is similar to a window in your operating system All components will appear inside the JFrame window Buttons, text labels, text fields, etc. 5 JFrame Your GUI program must inherit

More information

Introduction This assignment will ask that you write a simple graphical user interface (GUI).

Introduction This assignment will ask that you write a simple graphical user interface (GUI). Computing and Information Systems/Creative Computing University of London International Programmes 2910220: Graphical Object-Oriented and Internet programming in Java Coursework one 2011-12 Introduction

More information

Graphical User Interfaces 2

Graphical User Interfaces 2 Graphical User Interfaces 2 CSCI 136: Fundamentals CSCI 136: Fundamentals of Computer of Science Computer II Science Keith II Vertanen Keith Vertanen Copyright 2011 Extending JFrame Dialog boxes Overview

More information

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson)

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson) Graphics programming COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson) Overview Aims To provide an overview of Swing and the AWT To show how to build

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

State Application Using MVC

State Application Using MVC State Application Using MVC 1. Getting ed: Stories and GUI Sketch This example illustrates how applications can be thought of as passing through different states. The code given shows a very useful way

More information

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4.

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4. 1 - What if the main method is declared as private? 1. The program does not compile 2. The program compiles but does not run 3. The program compiles and runs properly ( From Lectuer # 2) 4. The program

More information

CMSC 331 Second Midterm Exam

CMSC 331 Second Midterm Exam 1 20/ 2 80/ 331 First Midterm Exam 11 November 2003 3 20/ 4 40/ 5 10/ CMSC 331 Second Midterm Exam 6 15/ 7 15/ Name: Student ID#: 200/ You will have seventy-five (75) minutes to complete this closed book

More information

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1 Datenbank-Praktikum Universität zu Lübeck Sommersemester 2006 Lecture: Swing Ho Ngoc Duc 1 Learning objectives GUI applications Font, Color, Image Running Applets as applications Swing Components q q Text

More information

Lecture 3: Java Graphics & Events

Lecture 3: Java Graphics & Events Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new

More information

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Frames, GUI and events Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Introduction to Swing The Java AWT (Abstract Window Toolkit)

More information

CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015

CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015 CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2015 Name: This exam consists of 6 problems on the following 6 pages. You may use your double- sided hand- written 8 ½ x 11 note sheet

More information

Assignment 3: Inheritance

Assignment 3: Inheritance Assignment 3: Inheritance Due Wednesday March 21 st, 2012 by 11:59 pm. Submit deliverables via CourSys: https://courses.cs.sfu.ca/ Late penalty is 10% per calendar day (each 0 to 24 hour period past due).

More information

McGill University School of Computer Science COMP-202A Introduction to Computing 1

McGill University School of Computer Science COMP-202A Introduction to Computing 1 McGill University School of Computer Science COMP-202A Introduction to Computing 1 Midterm Exam Thursday, October 26, 2006, 18:00-20:00 (6:00 8:00 PM) Instructors: Mathieu Petitpas, Shah Asaduzzaman, Sherif

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

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 143 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

COURSE DESCRIPTION. John Lewis and William Loftus; Java: Software Solutions; Addison Wesley

COURSE DESCRIPTION. John Lewis and William Loftus; Java: Software Solutions; Addison Wesley COURSE DESCRIPTION Dept., Number Semester hours IS 323 Course Title 4 Course Coordinator Object Oriented Programming Catherine Dwyer and John Molluzzo Catalog Description (2004-2006) Continued development

More information

8. Polymorphism and Inheritance

8. Polymorphism and Inheritance 8. Polymorphism and Inheritance Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich http://seal.ifi.uzh.ch/info1 Objectives Describe polymorphism and inheritance in general Define interfaces

More information

CSE wi Final Exam 3/12/18. Name UW ID#

CSE wi Final Exam 3/12/18. Name UW ID# Name UW ID# There are 13 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed book, closed notes,

More information

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM) DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR 2018-19 (ODD SEM) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB: OBJECT ORIENTED PROGRAMMING SEM/YEAR: III SEM/ II YEAR

More information

Project #1 Computer Science 2334 Fall 2008

Project #1 Computer Science 2334 Fall 2008 Project #1 Computer Science 2334 Fall 2008 User Request: Create a Word Verification System. Milestones: 1. Use program arguments to specify a file name. 10 points 2. Use simple File I/O to read a file.

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

Contents Chapter 1 Introduction to Programming and the Java Language

Contents Chapter 1 Introduction to Programming and the Java Language Chapter 1 Introduction to Programming and the Java Language 1.1 Basic Computer Concepts 5 1.1.1 Hardware 5 1.1.2 Operating Systems 8 1.1.3 Application Software 9 1.1.4 Computer Networks and the Internet

More information

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphic User Interfaces. - GUI concepts - Swing - AWT Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations

More information

OLLSCOIL NA héireann THE NATIONAL UNIVERSITY OF IRELAND COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2012

OLLSCOIL NA héireann THE NATIONAL UNIVERSITY OF IRELAND COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2012 OLLSCOIL NA héireann THE NATIONAL UNIVERSITY OF IRELAND COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK Summer Examination 2012 Computer Science CS5015 Object-oriented Software Development Prof.

More information

Overview. Lecture 7: Inheritance and GUIs. Inheritance. Example 9/30/2008

Overview. Lecture 7: Inheritance and GUIs. Inheritance. Example 9/30/2008 Overview Lecture 7: Inheritance and GUIs Written by: Daniel Dalevi Inheritance Subclasses and superclasses Java keywords Interfaces and inheritance The JComponent class Casting The cosmic superclass Object

More information

This page intentionally left blank

This page intentionally left blank This page intentionally left blank Absolute Java, Global Edition Table of Contents Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents Chapter 1 Getting Started 1.1 INTRODUCTION

More information

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide

Queens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide Topics for Exam 2: Queens College, CUNY Department of Computer Science CS 212 Object-Oriented Programming in Java Practice Exam 2 CS 212 Exam 2 Study Guide Linked Lists define a list node define a singly-linked

More information

Do not turn to the next page until the start of the exam.

Do not turn to the next page until the start of the exam. Principles of Java Language with Applications, PIC20a E. Ryu Fall 2017 Final Exam Monday, December 11, 2017 3 hours, 8 questions, 100 points, 9 pages While we don t expect you will need more space than

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Practice Midterm 1. Problem Points Score TOTAL 50

Practice Midterm 1. Problem Points Score TOTAL 50 CS 120 Software Design I Spring 2019 Practice Midterm 1 University of Wisconsin - La Crosse February 25 NAME: Do not turn the page until instructed to do so. This booklet contains 10 pages including the

More information

CSCI 136 Written Exam #1 Fundamentals of Computer Science II Spring 2014

CSCI 136 Written Exam #1 Fundamentals of Computer Science II Spring 2014 CSCI 136 Written Exam #1 Fundamentals of Computer Science II Spring 2014 Name: This exam consists of 5 problems on the following 6 pages. You may use your double- sided hand- written 8 ½ x 11 note sheet

More information

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7 PROGRAMMING DESIGN USING JAVA (ITT 303) Graphical User Interface Unit 7 Learning Objectives At the end of this unit students should be able to: Build graphical user interfaces Create and manipulate buttons,

More information

Chapter 13 Lab Advanced GUI Applications

Chapter 13 Lab Advanced GUI Applications Gaddis_516907_Java 4/10/07 2:10 PM Page 113 Chapter 13 Lab Advanced GUI Applications Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the

More information

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages. 1 CS257 Computer Science I Kevin Sahr, PhD Lecture 14: Graphical User Interfaces Command-Line Applications 2 The programs we've explored thus far have been text-based applications A Java application is

More information