Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This case study relates to the following Course Learning Requirements: CLR 1: Install and use the Java Development and Runtime Environment and documentation libraries. Install

This case study relates to the following Course Learning Requirements:

CLR 1: Install and use the Java Development and Runtime Environment and documentation libraries. Install and use the Eclipse Integrated Development Environment.

CLR 2: Write Java program code to solve a problem, based on a description of the problem context, including UML diagrams, using object-oriented techniques.

CLR 3: Explain and use basic data structures.

CLR 4: Inheritance

CLR 5: Use existing simple Generic classes to manage objects.

CLR 6: Write java code to implement exception handling.

CLR 7: Implement program Input/Output operations.

CLR 8: Produce tested code that executes correctly and consistently. Testing procedures will involve the use of: valid data only, invalid data only and a combination both valid and invalid data.

CLR 9:program documentation using prescribed program specifications.

CLR 10: Debug program problems using manual methods and computerized tools in an appropriate manner.

CLR 11: Identify appropriate strategies for solving a problem.

CLR 12: Introduce Swing for building a Graphical User Interfaces (GUI) using Java Foundation Classes.

 

Objective of this Case Study:

The objective of this case study is for students to:

  • Answer the questions presented using all the Java concepts described in this course.
  • Solve programming questions efficiently and determine the correct output in the various scenarios presented.
  • Develop a Java based application/project or game in Eclipse IDE, using a variety of important Java Programming concepts.

Pre-Assignment Instructions:

  1. To prepare you for this assignment, read all the module content and follow the embedded learning activities.

Case-study Tasks:

This case study is divided in to two parts:

  • Case-Study Part 1: Examination
  • Case-Study Part 2: Development of a Java Project

 

Part 1: Examination [70 marks]

 

Questions:

  1. List and explain various features of java. (Marks: 07)         
    1. Explain the words super, static, and final using examples (Marks: 07)

 

  1. Provide the output of the following program for the values of y=0 and y=2: (Marks: 07)

 

 

public class Test {   

public static void main(String args[])  {   

try   { 

System.out.println("calling method a"); 

a();  System.out.println("return from method a");   

 } catch(ArithmeticException e)   { 

System.out.println("main: catch");   

}   finally  { 

System.out.println("main: finally");

    }       }   public static void a()  {

try    { 

int x=8,y=0; 

int z=x/y; 

System.out.println("value of z="+z);

     } catch(NumberFormatException e)    {

System.out.println("method a:catch");   

 } finally 

 {  System.out.println("method a:finally");   

 }  }}

 

  1. Explain both overloading and overriding, and provide an example for each. (Marks: 07) 
    1. Declare a class called employee having employee_id and employee_name as members.
    2. Extend class employee to have a subclass called salary having designation and monthly) salary as members.
    3. Define the following:
      1. Required constructor.
      2. A method to find and display all details of employees drawing a salary more than 20,000/-.
      3. Method main for creating an array for storing these details given as command line arguments and showing usage methods.

 

 

  1. Describe abstract class called Shape. This class has three subclasses called: Triangle, Rectangle and Circle. Define one method area () in the abstract class and override this area() in these three subclasses to calculate the area for specific class' object. (Marks: 07)

       

 

  1. Declare a class called coordinate. This is to represent 3 dimensional Cartesian coordinates (x, y and z). Define the following methods: (Marks: 07)
    1. Constructor
    2. Display, to print values of members
    3. Add_coordinates, to add three such coordinate objects to produce a resultant coordinate object. Generate and handle exceptions if x, y and z coordinate of the result are zero.
    4. Main, to show use of the above methods. 

 

  1. Write a java application that has three Buttons labeled: Red, Green, and Blue. The java application should have the following:
    1. When clicking on the background, the color should change accordingly and have a label displaying the color selected. (Marks: 07)

 

                                                                                                                                                

  1. Write an application that creates and starts three threads. (Marks: 07)
    1. Each thread is instantiated from the same class.
    2. It executes a loop with 10 iterations.
      1. Each iteration displays the string "HELLO"
      2. Sleeps for 300 milliseconds.
    3. The application waits for all the threads to complete & displays the message "Good Bye...".

 

  1. Draw a use case diagram for a Library Management System. (Marks: 07)

 

  1. Answer the following: (Marks: 07)
    1. Collection in JAVA.
    2. Features of Map Interface.

Submission:

  1. Provide your answers to the above questions in a report format.
  2. Your assignment is to be submitted in MS WORD. It should be submitted with the following guidelines:
    • Include a cover page with the course code and course name, the assignment number, the title of your assignment, your student ID, your name, the instructor's name, and the date the assignment is created.
    • Ensure the first page of your assignment has the title at the top of the page and the questions of your report have headings and subheadings to chunk your paper into sections for each of the questions you are answering.
    • Font should be Arial 12 or Calibri 12. Text must be double spaced but table may be singlespaced.
    • You must cite all your sources of information using APA formatt  separate reference page that lists all of your sources that you have cited in text. Sources include software used. Also, personal communications from a professional in the field count as a reference source. For citation and referencing examples, see https://owl.purdue.edu/owl/research_and_citation/apa_style/apa_formatting_and_style_guide/general_format.html


 

 

Part 2: Development of a Java Project [30 marks]

The ultimate goal of this section is to generate a Java based project or game application of your choice, using all the Java concepts discussed in this course. 

 

Part 2: Instructions

  • You must develop Java applications using suitable coding and output.
  • The following concepts must be included in you project:
    • Class
    • Object
    • Encapsulation
    • Inheritance
    • Overriding
    • Overloading
    • Polymorphism
    • I/O files
    • GUI
  • These are the minimum requirements for your project. Any additional concepts not mentioned in the above list can be used in your Java Applications.
  • This application is to be developed using:
    • Coding statements, and correct programming steps for your entire project application.
    • Output screenshots after executing those programming steps.

Step by Step Solution

3.38 Rating (170 Votes )

There are 3 Steps involved in it

Step: 1

Without a specific topic or concept provided Ill explain a common programming concept polymorphism P... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago