Write a java 8 program that opens and reads a delimited data


Assignment Task: Accordingly, when loaded into NetBeans, each Part must be a separate project.

Part 1: Create a NetBeans 8 project for this Part, named Part1.

You are required to write a Java 8 program that opens and reads a delimited data file that is located relative to the NetBeans project root folder. The delimited data file contains fictional information about trading companies in North London. The data file is called traders.txt. The data file should not be altered and should be considered as a read-only data file.

Within the 'traders' data file, there are 25 lines each representing a single trading company. On each line there are six data fields representing the following information (in order): company name, location (in North London), the services offered by the company, the number of employees, a daily rate (pounds), and a general description of the trading company.

You are required to implement a Java class to represent a trading company. The program should parse the data file, create an object for each trading company, and store all the objects into a suitable collection.

Figure 3 provides a UML class representation of the class that you will need to implement. It indicates the six data members (denoted as private data), a series of public accessor (i.e., getter) methods that map to the data members, a single public constructor, and a toString() method.

Once all the objects are loaded into the collection, the program should present the User with a console- based menu to interact with the data set. This menu should loop until the User enters a character to exit the menu (e.g., zero as illustrated below). In addition to an exit option, the menu should offer four other options: list all traders, select a single trader, search on company location, and search for listed services.

On starting the program, the following menu should be displayed to the console:

List traders. 1

Select trader. 2

Search locations. 3

Search services. 4

Exit. 0

Enter choice:>

The User can simply exit the program by entering zero. The four other menu options allow the User to inspect the information in the data set (note again that this program is entirely read-only and there is no requirement to add, update or delete any part of the data set). The necessary interaction of the program with respect to these four options is illustrated in Appendix A.

Note that console output should be neatly formatted, and some consideration will be given to formatting when the program is assessed. In particular, when the option to view a single trade company details is selected, it should result in the invocation of the toString() method for that particular Trader object. You are encouraged to explore and utilise a StringBuilder object when implementing the toString() method for the Trader class.

Part 2: Create a new NetBeans project, called Part2.

For this Part you are required to write a Java 8 program that incorporates a series of classes that represent the core logic of an application and provides a NetBeans 8 console user interface. The required Java application relates to a proposed software system to manage some aspects of a gymnastics competition. Below is an initial description of the system domain with a few very simple use cases (i.e., just simple, natural language statements).

System domain

A gymnastics club holds an annual competition that includes events for both male and female gymnasts. For male gymnasts, there are six available events: Floor Exercise, Pommel Horse, Still Rings, Vault, Parallel Bars, and High Bar. For female gymnasts there are four possible events: Vault, Uneven Bars, Balance Beam, and Floor Exercise. Each gymnastics event has a specified start time and there is, for each event, a limit of 10 on the number of competitors who can compete in that event.

Each gymnastics event is organized by one or two club committee members, with each committee member organizing at least one gymnastics event. Each competitor is allocated a unique competitor's number. Both male and female gymnasts may compete in a minimum of two events and a maximum of four events.

When competing in an event, the competitor is awarded a score that is calculated with respect to the difficulty level of the competitor's chosen routine. Each competitor is allowed only one attempt at a selected event, apart from the Vault for which there are two attempts. The two attempts at the Vault must be different routines.

Use cases

1. List Event Information. The user of the software system identifies a gymnastics event. If the event is either the Vault or Floor Exercise, then the user also identifies if it is a male or female event. In response, the system displays the number and name of every competitor in that event, along with the name of the Committee Member(s) that are organizing that event.

2. List Competitor Events. The user of the software system identifies a competitor. In response, the system displays a list of all events that the competitor is entered in, and for each of those entered events, the system lists the routine description and difficulty rating for the attempt at that event.

3. List Event's Attempts. The user of the software system identifies a gymnastics event. If the event is either the Vault or Floor Exercise, then the user also identifies if it is a male or female event. In response, the system displays details of all attempts that have been completed for that event, including the name of the competitor, the routine description and difficulty rating, and the score that was achieved by the competitor for that attempt at the event if the attempt has already been completed.

Your Part is to design a Java 8 program for the gymnastics event management system described above, which provides a console-based (text I/O) user interface that facilitates the three listed use cases. An initial analysis of the domain has already been partially completed, and a partial class model has been designed as shown in Figure 4.

Your application should include Java classes for the above classes as a minimum, but you should bear in mind that the above illustration is only a partial model. You are not required to submit any UML for this Part. The partial class diagram above is provided as a design guide for your Java implementation.

In order to operate with the console-based User interface, your application will require some 'dummy' data to be pre-coded into the application. This should be achieved by 'hard-coding' data within the Java program. It should not use any data layer component or SQL database link. There is no requirement to 'write' any data for the Part. All pre-coded data should be read-only.

Part 3: Create a new NetBeans project

For this Part you are required to program a JavaFX Graphical User Interface (GUI), with a focus on layout and event handling.

This program must be coded as a JavaFX program following the approach described in Chapters 14 to 16 of the kortext. It must not be created using a visual drag-and-drop tool, and must not be an FXML program, neither of which have been taught on the module. If the submission is either a drag-and-drop application, or a FXML application, then it will simply be awarded zero marks.

The GUI application that you need to create is a basic 'smart home controller' application.

The application comprises three areas representing controls for lighting, central heating and CCTV. Each area on screen comprises JavaFX nodes and controls. The lighting area comprises Labels, Sliders and Circle objects. The central heating area comprises a Label, RadioButtons, a Slider and a TextField. The CCTV area comprises a Label, four ImageViews and four associated ToggleButtons.

a) Write a JavaFX program that replicates (accurately) the GUI layout The focus should be entirely on accuracy of layout, and there are no marks for styling using CSS. The illustration shown in Figure 5 is the default look and feel of JavaFX in Windows NetBeans 8 and that is all that is expected of your program.

b) Implement event handling for the GUI as follows:

  • For the lighting area, the colour of each Circle object should change in response to the associated horizontal slider being dragged. When the Slider is dragged to the left the colour should 'darken', and when dragged to the right, the colour should 'lighten'.
  • For the central heating area, the RadioButtons should operate correctly in that only one RadioButton can be selected at a time (i.e., they are mutually exclusive in terms of selection). The Slider must be vertical and when dragged up or down the value in the TextField must be updated to reflect the value on the Slider.
  • For the CCTV area, each of the four ImageViews should be mapped to one of the four ToggleButtons. Clicking on any of the four ToggleButtons should result in the associated image being 'blacked out' (clicking again would reveal the image again).

Viva Voce Assessment:

Please note carefully that his assignment is an individual assessment.

Following submission and marking of assignments, and as part of the module assessment moderation procedure, a cross-section of students will be required to attend a follow up viva voce assessment with the teaching team. These appointments will be arranged after first phase (provisional) marking has been completed.

Note: All figures are attached

Do complex and monotonous Object Oriented Programming assignments and homework often bothers you? Then, without any delay, you must avail our Object Oriented Programming Assignment Help service for better academic grades.

Tags: Object Oriented Programming Assignment Help, Object Oriented Programming Homework Help, Object Oriented Programming Course Help, Object Oriented Programming Solved Assignments 

Attachment:- Object Oriented Programming.rar

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a java 8 program that opens and reads a delimited data
Reference No:- TGS03049638

Expected delivery within 24 Hours