Está en la página 1de 4

Middle East Technical University

Department of Computer Engineering

CENG 305
Object Oriented Programming with Java
Spring 2014-2015

Warm-Up
Due date: 27 March 2015, Friday, 23:55

Objectives

First of all, download the project assignments file of the textbook. It can be downloaded from the following link:
http://highered.mheducation.com/sites/007337606x/student view0/index.html
This assignment aims to make you familiar with basic concepts of Object Oriented Programming. You are
expected to write java code for the following three problems. The specification for the classes/methods
will be given in the specification section.

Questions
1. Write java code for the following flowchart (see on Figure 1). This question is related to Project
2.2 in project assignment.
2. Write a java program that finds 100th birthday for a person according to pseudocode given in Figure
2 (Project 3.12).
3. Write the java program for the Bank Balance problem in Project 4.4.

Specifications
1. Programming Language : You will use Java (version 1.7) to implement the assignment. You
should use BlueJ IDE to write and implement Java code. You can download it from www.bluej.org.
2. Class Definitions : Implement the following classes :
(a) The class named Bonus to solve the project 2.2.
(b) The class named Birthday to solve the project 3.12.
(c) The class named BankBalance to solve the project 4.4.
(d) The class named Test1.java to test your solutions.

Bonus, Birthday, and BankBalance classes should have solve bonus, solve birthday, and
solve bankbalance methods, respectively. These methods should include the solution to the
corresponding problems. In your Bonus, Birthday, and BankBalance classes, you should import
javax.swing.JOptionPane library to get inputs and show the results as it is shown in Figure 4.
You should design and implement Test1.java class such that the main function will properly invoke
the method of the classes above in a loop in accordance with menu shown in the sample output
below. You can take Figure 4 as reference. Your test class should run one of the methods unless -1
is entered. If the user inputs -1, program should terminate.
Refer to the text book project questions for the full text of the project problems mentioned above.
UML diagram is given in Figure 3 as reference. Note that it may not be complete UML diagram.
Please note that your implementations will be tested with different test classes as well
as yours. You can assume that the inputs will be in the correct formats.

Regulations
1. Submission Type: You will submit a zip file named such as e1234567 warmup.zip which includes
all your BlueJ project files with all generated javadoc files for your classes, methods.
2. Late Submission: Late submission penalty is calculated as 5 days days for each homework.
3. Cheating: We have zero tolerance policy for cheating. People involved in cheating will be
punished according to the university regulations.
4. Newsgroup: You must follow the newsgroup (news.ceng.metu.edu.tr) for discussions and possible
updates on a daily basis.
5. Evaluation: Your program will be evaluated automatically using black-box technique so make
sure to obey the specifications.

Figure 1: Flowchart of Question 1

Figure 2: Pseudocode For Question 2

Figure 3: UML Diagram

Figure 4: Sample Run

También podría gustarte