Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Task 1 -

For this task you will create a Subject class, whose instances will represent the subjects for study at a university. A subject will have a name, just a String (for example, Programming in java 1), and a subject code (for example, ITC206), which is a six-character String. The first three characters of a subject code are alphabetic and the last three are numeric. The first three characters define the subject's discipline area. A subject code must be unique.

You will also write a TestSubject class to test the use of your Subject class. In particular this will maintain an array of subjects. In order to manage the uniqueness of the subject codes, your program will need to display information about existing subject codes as well as checking that any new subject code supplied by the user is not the same as any existing subject code.

The following state and functionality should be provided for the Subject class:

  • Two fields will hold the subject's name and the six-character subject code.
  • A constructor will allow a name and a new, validated subject code to be provided when a new subject is created.
  • Getters will provide access to the attributes i.e. subject name and subject code.
  • An accessor method called getDiscipline will return a string containing the first three characters of the subject code (for example ITC from ITC206 subject code).
  • Another accessor method called codeMatches will return a boolean value indicating if the subject's code matches the string argument provided. "Matches" is used here in the same sense as for the matches method of the String class.
  • A toString method will return a string containing the subject code and subject name.

To assist with managing subject codes and their uniqueness you will provide the Subject class with some class methods as follows:

  • An allDisciplines method will accept an array of Subject objects. It will return an array containing the different 3-character discipline codes represented in the array of subjects in alphabetically order.
  • A codesPerDiscipline method will accept an array of Subject objects and a 3-character discipline code. It will return an array containing the different subject codes represented in the array of subjects for the particular discipline.
  • An isValidCode method will accept a string that is a possible new subject code, and return a boolean indicating whether it satisfies the structural requirements for a subject code.
  • A codeExists method will accept an array of Subject objects and a possible new subject code. It will return a boolean indicating whether that code has already been allocated to one of the subjects in the array.
  • A sortDisciplines method will accept an array of Subjects objects. It will return the sorted array of subjects in alphabetically order (you may sort based on the subject code only).

Your TestSubject program will perform the following sequence of actions, using good design techniques such as in the appropriate use of methods:

  • An initial array of Subject objects will be created from any data in a file that was previously saved by the program. Then you need to read Subject objects from the file and store in appropriate array using your java program.
  • The user interaction will then proceed to allow the user to add one or more new subjects to the array. If the user wishes to add new subjects, the discipline areas of existing subjects should be displayed in alphabetically order. The user will then enter a discipline code to which the program will respond by displaying any existing subject codes in that discipline. This procedure simplifies the user's task of choosing subject codes that do not already exist, but does not prevent user mistake. Each subject code entered by the user should be checked. The user can enter any new subjects in that discipline (or indeed in other disciplines). The user should be given the choice of repeating the processing for other discipline areas.
  • When the user has finished adding subjects, and only if subjects have indeed been added, the program will overwrite the data file with the updated data.

Note: You may use an ArrayList to implement an array if you prefer and it is appropriate.

Task 2 -

In this task, you are required to provide complete class definitions and then create instances of various classes and use methods to perform various tests.

(a) Define an abstract class called Textbook with the following fields and methods:

  • Fields: title, author, pages representing the title, author and the number of pages of a textbook for a given book respectively. Encapsulation should be used to protect these fields against intentional or accidental, direct modification
  • Constructors: a no-args default constructor, and an overloaded constructor to initialise the fields to appropriate values when the instances of the class are created
  • Methods: a toString() method to print a string representation of the objects, get and set methods to provide access to each of the three fields

(b) Define a subclass of the Textbook class called Programming Textbook with the following additional field and methods:

  • Field: language representing the particular language the programming textbook uses. Again, encapsulation should be used to protect this field against intentional or accidental, direct modification
  • Constructors: a no-args default constructor, and an overloaded constructor to initialise the fields to appropriate values when the instances of the class are created
  • Methods: a toString() method to print a string representation of the objects, additional get and set methods as required to provide access to the field

(c) Define another subclass of the Textbook class called Engineering Textbook with the following additional field and methods:

  • Field: subject representing the particular engineering subject the textbook teaches. Again, encapsulation should be used to protect this field against intentional or accidental, direct modification
  • Constructors: a no-args default constructor, and an overloaded constructor to initialise the fields to appropriate values when the instances of the class are created
  • Methods: a toString() method to print a string representation of the objects, additional get and set methods as required to provide access to the field

(d) Finally, define another class called Test Textbooks with a main() method to perform necessary testing for the classes defined in the previous sections.  In the main method, write the code to create at least two objects of the Programming Textbook class and at least two other objects of the Engineering Textbook class. Create an ArrayList object to store references to these objects and then test various methods of the objects using loop(s) and methods as necessary.

Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.

Task 3 -

Write a Java program using JavaFX that displays five playing cards. In the first row display three playing cards (randomly selected from the first 52 cards). In the second and third rows display a Joker card at 45 degree and 90 degree angles respectively.

The image icons used in the questions are available in the Resource folder of Interact2. You may need to use HBox and/or VBox Pane.

Task 4 -

Investigate the imperative programming paradigm, as exemplified by procedural programming and object-oriented programming, and the declarative programming paradigm, as exemplified by functional programming and logic programming.

The Reading from Brookshear, 2012 will form a starting point for your investigation. For further investigation, remember that you should not reference Wikipedia items in an essay, so make sure to find articles that you can reference.

Write an essay, of approximately 800 words, based on your investigation, which provides answers to the following questions:

  • What are the essential differences between the paradigms?
  • What are some of the programming languages used for these different paradigms?
  • What specific advantages are provided by these different programming approaches?

Your essay should be referenced using the APA referencing style.

Material to submit for Task 1:

1. You need to submit the java and class files

2. You also need to submit a doc/pdf file with following information:

a. Analysis:  Describe the problem including input and output in your own words (not more than 400 words)

b. Testing: Describe how you test this program (not more than 400 words)

c. Output: Copy and paste a snapshot of the program output

Material to submit for Task 2:

1. You need to submit the java and class files

2. You also need to submit a doc/pdf file with following information:

a. Analysis:  Describe the problem including input and output in your own words (not more than 400 words)

b. Testing: Describe how you test this program (not more than 400 words)

c. Output: Copy and paste a snapshot of the program output

Material to submit for Task 3:

1. You need to submit the java and class files

2. You also need to submit a doc/pdf file with following information:

a. Analysis: Describe the problem including input and output in your own words (not more than 400 words)

b. Testing: Describe how you test this program (not more than 400 words)

c. Output: Copy and paste a snapshot of the program output

Material to submit for Task 4:

1. You need to submit a doc/pdf file which includes the easy.

Attachment:- Assignment Files.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92311024
  • Price:- $240

Guranteed 48 Hours Delivery, In Price:- $240

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As