Java course. Assignment #2, due: Feb. 27, 2004 1.(20) (a) Tell the difference between the abstract class and the interface. (b) Tell the difference between.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Polymorphism Method overriding Method overloading Dynamic binding 1.
Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
LAB SESSION 7 Graphical user interface Applet fundamentals Methods in applets Execution of an applet Graphics class.
Operator Overloading. C++ 2 Outline  General technique  Overloading of the assignment operator  Overloading the increment and decrement operators.
Chapter 2 Programming by Example. A Holistic Perspective Three sections separated by blank lines. Program comment File: FileName.java
Java Inheritance. What is inherited A subclass inherits variables and methods from its superclass and all of its ancestors. The subclass can use these.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Program design example Task: Develop an algorithm expressed in pseudocode for a specified problem specified problem.
 Pearson Education, Inc. All rights reserved Multimedia: Applets and Applications.
Chapter 3 - Introduction to Java Applets Outline 3.1Introduction 3.2Thinking About Objects 3.4A Simple Java Applet: Drawing a String 3.5Two More Simple.
UML Class Diagram: class Rectangle
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Chapter 11: Inheritance and Polymorphism Java Programming: Program Design Including Data Structures Program Design Including Data Structures.
Chapter 5 Using Business Information Sets
CMSC 104, Version 9/01 1 The Box Problem: Write an interactive program to compute and display the volume and surface area of a box. The program must also.
Copyright 2008 by Pearson Education Building Java Programs Chapter 9 Lecture 9-4: Interfaces reading: self-check: exercises: #11.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Applets Java API.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Agenda For Feb Discussion (Assignments & Rubric) 2. PowerPoint Presentation (Drawing Basic Shapes). 4.Read Unit 3 carefully (pages ) then.
 Bitmap: A bitmap is a rectangular array of 0s and 1s that serves as a drawing mask for a corresponding rectangular portion of the window.  Applications:
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
 2005 Pearson Education, Inc. All rights reserved Multimedia: Applets and Applications.
Chapter 11 Inheritance and Composition. Chapter Objectives Learn about inheritance Learn about subclasses and superclasses Explore how to override the.
Lecture Objectives  Learn what is an ADT, why is it useful  Understand algorithm efficiency  Use Eclipse for coding and testing  Understand and use.
© 2007 Lawrenceville Press Slide 1 Chapter 2 HTML An example HTML document Hello world!
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Introduction to Applets CS 3505 Client Side Scripting with applets.
ImageJ EE4H, M.Sc Computer Vision Dr. Mike Spann
Attendance Training Presented By: MIS Department.
CMSC 104, Section 301, Fall Lecture 06, 9/18/02 Algorithms, Part 3 of 3 Topics Disk Quota Exceeded. Using Pine. More Algorithms Reading Read.
Java ProgrammingtMyn1 Java Programming Timo Mynttinen Mikkeli University of Applied Sciences.
COSC 1P02 Introduction to Computer Science 9.1 Cosc 1P02 "A lie gets halfway around the world before the truth has a chance to get its pants on.” Sir Winston.
Introduction to Java Simple Graphics. Objects and Methods Recall that a method is an action which can be performed by an object. –The action takes place.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
Countdown banner Five color schemes: purple, orange, blue, blue/purple, yellow/purple Implementation Example Layout examples - landscape NOW LIVE ON YOUR-LIFE.COM.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Picture This! Multiply Fractions by drawing arrays.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
2 Objectives You should be able to describe: Object-Based Programming Classes Constructors Examples Common Programming Errors.
1 Algorithms Practice Topics In-Class Project: Tip Calculator In-Class Project: Drawing a Rectangle.
Interfaces Chapter 9. 9 Creating Interfaces An interface is a contract. Every class that implements the interface must provide the interface’s defined.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 11 Inheritance and Polymorphism.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 2 – Welcome Application Introduction to Graphical.
Creating a Java Application and Applet
Peyman Dodangeh Sharif University of Technology Fall 2014.
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
HTML Overview Part 8 – Java Applets 1. Applets 2  A Java applet is a small application embedded in your HTML document which runs in the browser window.
Midterm: Question 1 (35%) (30 minutes) Write an assembly program to draw a rectangle. – (5%) Show a message to ask for information of the rectangle – (5%)
Interfaces, Abstract Classes, and Polymorphism. What Is an Interface? An interface is the set of public methods in a class Java provides the syntax for.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Week 19 day 4 6 A school increases the width of its rectangular playground from 25 meters to 40 meters and the length from 45 meters to 60 meters. By.
Element of Design Form Shape Line Color Value Texture Space.
Basic Graphics 03/03/16 & 03/07/16 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
Java Expert Session By: Prof. Mehul Raval Prof. Adarsh Patel Prof. Mihir Suthar.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Advanced Programming in Java
Chapter 11: Inheritance and Polymorphism
UML Class Diagram: class Rectangle
Sketch the region enclosed by {image} and {image}
Sketch the region enclosed by {image} and {image}
Teaching Java using Turtles part 2
Java Inheritance.
Inheritance in Graphics
UMBC CMSC 104 – Section 01, Fall 2016
Teaching Java using Turtles part 2
Advanced GUIs and Graphics
Presentation transcript:

Java course. Assignment #2, due: Feb. 27, (20) (a) Tell the difference between the abstract class and the interface. (b) Tell the difference between the method overloading and the method overriding. (c) Using an example to specify what is "upcasting"? (d) Using an example to specify what is "polymorphism"? 2.(20) (a) Create your home page. (b) Write an applet that draws a rectangle. The dimensions of the applet should be 250  200 pixels. The rectangle should be centered in the applet and have a width and height of 200 and 150 pixels, respectively.

Java course. Assignment #2, due: Feb (20) Draw an applet displaying 13 horizontal color bars that corresponds to the constants defined by the Color class provided by Java. 4.(20) Implement an "applet" which contains two parts: i) Lamp.html ii)Lamp.class

Java course. Assignment #2, due: Feb. 27, (20) Write a program which prompts for a date in the format dd/MM/yyyy and prints the date in the form Month day, Year. For example, 17/05/2001 should print May 17, (Use the switch statement.) Your program should verify that the day is between 1 and 31, the month is between 1 and 12, and the year is between 1000 and Generate errors messages if the input is invalid. Test your program on the following inputs: 17/05/ /00/ /12/1999 Note: You do not have to handle cases where a month has only 28, 29, or 30 days.