SENG6110 Object Oriented Programming Assignment

Assignment Help Programming Languages
Reference no: EM133124708

SENG6110 Object Oriented Programming - The University of Newcastle

Introduction
The objective of this assignment is to extend the implementation of Assignment.

Specifications
Create a database which will hold up to 2 region objects. Each region object may have up to 3 dwarf planets in it - see the sample data in the file "input_data.csv". To implement this you should use arrays, one array of up to 2 region objects each with its own array of up to 3 dwarf planets as an attribute.

Question 1. Add a region.
The user will specify a) the region name, b) the width in AU and c) the population of objects with diameters greater than 100km. There should be an error message if the region name already exists in the array, or if there are already 2 region objects in the array.

Question 2. Add a dwarf planet object to one of the region objects.
The user will specify the region name (the object to which this dwarf planet is being added), dwarf planet name, diameter (km), mass (x1021kg) and number of moons. There should be an error message if the dwarf planet already exists, or if the region does not exist, or the region already has 3 dwarf planet objects.

Question 3. Delete a region.
The user will specify the region name. There should be an error message if the region does not exist. This will also cause any dwarf planet objects in that region to be deleted.

Question 4. Delete a dwarf planet.
The user will specify the region and dwarf planet name. There should be an error message if either do not exist. If there exists a region containing that dwarf planet, the region should be updated.

Question 5. List all objects.
The output should list all regions and dwarf planets with all attributes included. If there are no objects, the output should be: "No objects exist". Otherwise, one line should be output for each object with one of these formats:
REGION name width largeObjects
DWARF PLANET regionName dwarfPlanetName diameter mass moons

Question 6. List the dwarf planets that belong in a region.
The user will specify the region name. If the region contains no dwarf planet objects, the output should be: "No dwarf planets contained in this region." Otherwise, one line should be output for each dwarf planet, with this format:
DWARF PLANET regionName dwarfPlanetName diameter mass moons

Question 7. List the dwarf planets with a mass greater than 4 x 1021kg.
The output should be in the format:
DWARF PLANET regionName dwarfPlanetName mass

Question 8. List the dwarf planet with the smallest diameter in each region.
There should be an error message if there are no dwarf planets in the database. The output should be in the format:
DWARF PLANET regionName dwarfPlanetName diameter

Question 9. Import region and dwarf planet information from a file.
The user will specify the name of the file to be read from. The program should expect a file consisting of zero or more lines. Each line should have one of these formats:
REGION name width largeObjects
DWARF PLANET regionName dwarfPlanetName diameter mass moons

The imported data should replace any pre-existing objects. A REGION line in the input file should cause addition of the described region object. Similarly, a DWARF PLANET line should cause addition of the described dwarf planet. An error message should be output if the file is unable to be opened, or if a problem occurred during reading the file. This includes cases such as finding a line with an invalid format and being unable to add a region or dwarf planet due to one of the issues listed under functionalities 1 and 2 (in both cases, the program should continue to process the rest of the file). An example of a file which could be used (after the heading lines are removed) is included as input_data.csv.

Question 10. Write region and dwarf planet information to file.
The user will specify the name of the file to create. The created file should have the same format as that used for importing. An error message should be output if the file is unable to be created, or if a problem occurred during writing.

Program Requirements

In this assignment you should use arrays to store the region and dwarf planet objects. Use two constants specifying array sizes.

The program should consist of three classes (and ONLY three classes). Use the supplied "files to start with", do not change their names or add any additional files.

All instance variables of your classes should be private (this is imposed so that you apply the principles of encapsulation).

Your classes will need methods to provide the required functionalities. The only class which should have a main() method is Interface.java.

Attachment:- Programming Assignment.rar

Reference no: EM133124708

Questions Cloud

How many copies of the software should i attempt to sell : Shaughnessy Consulting, LLC currently enjoys a patent on software that estimates economic damages for clients involved in personal injury lawsuits. Demand for m
Which firm should Andy purchase : The MD&A shows positive news for Wilson and negative news for Zytec. Which firm should Andy purchase? Show calculations
Process of turning sugar into candy canes : For a company that produces candy canes, sugar is 70 percent of its ingredient costs. The United States limits the imports of sugar to protect cane farmers, whi
Calculate the total effect on welfare of a tariff : A small country can import a good at a world price of 5 per unit. The domestic supply curve of the good is S = 10 + 10P. The demand curve is D = 600 - 5P. In ad
SENG6110 Object Oriented Programming Assignment : SENG6110 Object Oriented Programming Assignment Help and Solution, The University of Newcastle - Assessment Writing Service
Find the optimum replacement interval for equipment : A tractor can be purchased for $45,000. Annual O&M costs are expected to increase $1,500 every year, with a 1st year O&M cost of $3,000.
Determine amount of overhead assigned to each product line : Determine the amount of overhead assigned to each product line if Product A requires 70% of the labor hours and Product B requires 30%
Pw analysis and cash flow approach : A regional architecture/contractor firm, purchased an HVAC unit for $25,000 that was expected to last 15 years. It has a salvage value of $0 in 10 more years.
Explain moral hazard in credit markets : Explain how moral hazard in credit markets lead to credit rationing.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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