Implement programs in java

Assignment Help Computer Engineering
Reference no: EM131237946

Assessment Objectives:

- to design programs that conform to given specifications
- to practise combining multiple classes and methods into a whole program
- to implement programs in Java.
- to practice using arrays of objects.

Please also note carefully that whilst we encourage innovation and exploring java beyond what has been presented in the subject to date, above all, we encourage understanding.

The assignment that follows can be solved using techniques that have been presented in lectures, lecture / workshops and labs so far.

These are the techniques and knowledge that we will later be examining in the Real Time Test and the exam.

Code and techniques that are outside the material presented will not be examined, of course. You are free to implement the program below in any way, with one condition.

Any assignment that uses code that is outside what has been presented to this point must be fully explained at the marking execution test. Not being able to fully explain code outside what has been presented in the subject so far will result in the assignment being awarded a mark of 0, regardless of the correctness of the program.

Problem Background

Flight operations on an aircraft carrier are very complex and potentially dangerous. They involve launching aircraft (take off), monitoring aircraft in flight and recovering aircraft (landing). All phases of these operations need to be carefully coordinated to prevent accidents.

Assignment C explored all aspects of these operations, using just 2 Planes. This proved to be such a success that now it has been decided to scale up the program to handle a full air group of 90 Planes.

Planes can now have more than one Crew, but still must have at least one Crew assigned to the Plane before it can be assigned a mission and the Plane must not already be on a mission. When the Plane is on a mission, it is flying, also known as being airborne. It is not possible to have a Crew without there being a Plane first. It is possible to have a Plane without a Crew.

When a Plane is first created, it is placed (added) on the flight deck of the carrier. This means, of course, that when a Plane is first added, it has no Crew, is not on a mission and is not airborne.

As the Plane (and the assigned Crew) fly more missions, the experience level of the Crew increases. The experience level must case insensitive.

If the Crew has flown less than 5 missions, then their experience level is trainee
If the Crew has flown 5 missions or more, but less than 11 missions, then their experience level is regular
If the Crew has flown 11 missions or more, but less than 25 missions, then their experience level is veteran
If the Crew has flown 25 missions or more, then their experience level is elite

As soon as the Plane (and all associated Crew) are assigned a mission, the number of missions for all the Crew, of that Plane, is incremented by 1 and the Plane takes off successfully and is airborne.

To end a mission, the Plane must first actually be airborne, if this is the case, then the Plane is considered to have landed safely and is no longer airborne.

Further changes from Assignment C

Every time the program goes through one cycle of the main menu, each Plane that is on a mission has the time that it has been on a mission incremented by 1.

Since there now can be Planes with more than one Crew, how a Plane is assigned a mission has changed.

The user is asked to enter the experience level required for the mission. You may assume that the user enters one of the four experience levels that apply to the Crew.

As before the first thing that must occur is that the program must find that Plane with the tail number, as entered by the user and check that the Plane is not already on a mission. If both these conditions are true, then the user enters the required experience level of the mission.

To be assigned the mission, the average experience level of all the Crew in that Plane must be equal to or greater than the experience level of the mission

as entered by the user.

How to determine the required experience level.

If the required experience level of the mission is Trainee, then the Plane can undertake this mission (if the tail number matches and the Plane is not on a mission, of course). This is because the experience level of all the Crew in that Plane must be at least Trainee (the starting level)

If the required experience level of the mission is Elite, then only if every Crew, of that Plane, has the Elite experience level could the Plane be assigned the mission. Even one Crew member below Elite experience level would disqualify the Plane.

If the required experience level was Regular, for example, and there were four Crew members, if that Plane, one at Trainee, two at Regular and one at Veteran, then the average experience level rating of the whole Crew is Regular and the Plane could be assigned the mission.

If the required experience level was Veteran and 3 out 4 of the Crew, of that Plane, were Veterans, but one was Regular, then the average experience level is below the required mission experience level and the Plane could not be assigned the mission. On the other-hand if 3 out 4 of the Crew were Veterans and the other Crew member had an Elite experience level, then that overall average is above Veteran and the Plane could be assigned the mission (assuming all other conditions are met)

How you assign values to the experience levels to come up with this average is up to you.

Program Requirements

You have been asked to write an interactive program, in Java, to aid in monitoring and maintaining all aspects of Flight Operations.

This program expands on the earlier work done in Assignment Part C and now needs to handle 90 Planes. Each Plane can have more than one Crew associated with it.

To aid in the rapid development of this program, 3 Java files and 1 sample input file are provided for you:
Crew.java, Plane.java, Carrier.java and a sample input file a.dat

Copy them from the unit library area into your current directory using:
cp /home/1st/csilib/cse1oof/prog/* .

In order to further speed up the development of this program, some of the files listed above have been partially implemented for you, read the comments in the files and in this document.

Crew.java (almost the same as Assignment Part C) All Crew objects have the following object attributes:

- name This a String (text) and is the name of the Crew, may be more than one word
- role This a String (text) and is the role (job) of the Crew, may be more than one word
- id This is an integer and is the unique id of the Crew
- missions This is an integer and is the number of missions that the Crew has undertaken.
- experience level This is a String and is one of the four levels as described
above. The experience level is always based on the number of missions that the Crew has flown and must be set by the program. The user must NEVER be able to enter the experience level, nor is it ever stored in a file.

The Crew class requires the following functionality:

A constructor that takes name, id, role and missions as parameters. This is the constructor that is called when a new Crew is added from the text file. From the file, all four of these parameters have values.

You might want to consider writing a copy constructor for the Crew. The format of the text file is shown on page 10
Recall that it is the number of missions that determine the experience level, so there has to be a way for the constructor to set the experience level. If this constructor is also used for keyboard input, then the number of missions must be set to 0 as the Crew has just been created.

Alternatively, you could write an overloaded constructor that just takes the first three values (name, role and id) as parameters and assigns 0 to the number of missions.

Either way, the experience level must be set by the constructor, not the user. The Crew class also requires accessor methods as you deem appropriate.
The Crew class also requires a method to increment the number of missions. Calling this method adds 1 to the number of missions, which can change the experience level.

The Crew class requires a toString method which returns a String with information about the Crew object, see page 16 for the format of the String to be returned.

Please note that this time you are free to format the screen output in any way, provided only that the user of the program can easily understand the information being displayed.

This is Carrier Air Group operations after all, the users need to be able to take in the information at a glance, not spend time trying to decipher poorly formatted output.
Planes don't stop in the air while the user tries to read information.

The one addition to the functionality of this Crew class that you might (optional, not have to) consider is a method that can be called to write all of the Crew information to a text file.

There are other ways of doing this, this is not the only way and is NOT the "right" answer.

Plane.java (some major changes)

The Plane class has the following attributes:

- name This is a String (text) and is name of the Plane, may consist of more than one word
- model This is a String and is the model of the Plane, may be more than one word
- flying This is a boolean variable, the value false indicates that the Plane is not flying (airborne) which means that the Plane is NOT on a mission. The value true indicates that the Plane is airborne and so is on a mission

- tail number This is a String (text) and may consist of more than one word The tail number is the unique identifier for a Plane

- crew This is now an array of Crew class object references for the Crew objects associated with this Plane (when the Crew objects are added and instantiated)

- max crew This is the maximum number of Crew that can be in this Plane. This is set by the user when the Plane object is created

- current crew This is the current number of Crew actually in the Plane, starts at 0 when the Plane is instantiated

- mission time This is the number of "turns" (through the main menu) the Plane has been on a mission. The mission time is reset to 0 when the Plane ends a mission.

Attachment:- Assignment.rar

Reference no: EM131237946

Questions Cloud

Evaluate the effectiveness of its reward systems : Give an example of how an organization might evaluate the effectiveness of its reward systems. Be sure to include specific metrics and the data that would be gathered as part of the evaluation process.
Health care delivery system : Do you believe that there is too much or too little redundancy in our health care delivery system? Where does most of the redundancy occur? Where should we have more redundancy (second opinions)?
Distinguish between the julian and gregorian calendars : Distinguish between the Julian and Gregorian calendars
Calculate the value of the stock or futures contracts : Use the DerivaGem software to calculate the value of the stock or futures contracts that the administrators of the portfolio insurance schemes will attempt to sell if the market falls by 23% in a single day.
Implement programs in java : CSE1OOF/4OOF- to design programs that conform to given specifications and to practise combining multiple classes and methods into a whole program.
Distinguish between altitude and zenith angle : What is your zenith? Distinguish between altitude and zenith angle. How were the latitude and longitude of a ship determined in early sailing days? Distinguish between a tropical year and a sidereal year.
Identify claims better left unstated : Analyze the argument passage below, addressing the following as appropriate: specify the issues addressed; identify premises and conclusions; classify as inductive or deductive; supply missing premises; separate arguments from window dressing; ide..
Report addressing a quantitative analysis : Write a report addressing a quantitative analysis (QA) project. Here, you are asked to select a business of interest and develop QA best practices that can be developed and implemented to increase revenues and/or to decrease costs. Please provide ..
How does the date change when one crosses the idl : How does the date change when one crosses the IDL? What periodic motion is used as a reference for our year? Describe the apparent north-south motion of the overhead Sun throughout the year. What causes this?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Privacy concerns related to data mining process

Analyze the privacy concerns raised by collection of the personal data for mining purposes. Choose and describe three (3) concerns raised by the consumers.

  You are the project manager for a new high rise office

1.estimating proceduresa you are the project manager for a new high rise office building. you are working on estimating

  Studying the relational database

On the basis of this relational database; provide an expression in the relational algebra in order to express each of following queries: Determine the names of all students who have GPA greater than 3.

  Assume monetary benefits of an information system of 40000

assume monetary benefits of an information system of 40000 the first year and increasing benefits of 10000 a year for

  Desirable to force users to creat an explicit choice

Why is it not desirable to force users to build an explicit choice of a query processing strategy? Are there cases where it is desirable for users to be aware of the costs of competing query-processing strategie.

  Write down a 2- to 3-page paper which compares and

designing and coding a procedure module or object can be complex and time consuming. once these elements of a computer

  What you have learned about cloud-based office productivity

Based on what you have learned about using cloud-based office productivity software, create a 5-slide presentation to the department head or CEO to convince him or her that using a cloud-based office productivity suite would benefit the company.

  Describe total cost of ownership and include descriptions

using the module readings and the argosy university online library resources research methods of developing proposals

  Create the illusion that each user has a dedicated machine

CS-155 Concepts of Computer Science - Which of the following tracks the progress of a program during execution and create the illusion that each user has a dedicated machine?

  Design a program whcih will allow a user to input a list of

design a program that will allow a user to input a list of your family members along with their age and state where

  Part-1task 1 the first task in this assignment tests your

part-1task 1 the first task in this assignment tests your knowledge of what is required to build a fully-functioning

  How to enlarge the size of the array

How to enlarge the size of the array? Enlarge the size of the array to 25. Driver will start with 10 objects in it other than has provision for up to 15 new objects. You can use java any API.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd