Implement an object-oriented program

Assignment Help JAVA Programming
Reference no: EM133107618 , Length: word count:2500

Dwarf Planets Database

Introduction
The objective of this assignment is to implement an object-oriented program (using Java) to manage a database of objects containing information about dwarf planets in our solar system.

Specification
Your database will hold nine dwarf planets with the attributes listed below. See the file "dwarf_planet_data.csv" for the complete data.

When run, the program will display a menu of actions to the user, including one that exits the program. Until the user chooses to exit, the menu is displayed again after each action is completed. A working menu is supplied in the file Interface.java - you should modify this code for your own answer. Do not completely re-write it, but add to it where necessary.

Write code to do the following. Most of this code will be added to the file Interface.java - add code to the other two classes when appropriate.

Menu option 1. Create the nine dwarf planet objects.
This involves

a. Completing the DwarfPlanet.java class with the attributes listed below. You should write getter (accessor) and setter (mutator) methods for all attributes.

b. The DwarfPlanet class should have two constructor methods, one which will set the values of all attributes from parameters in its call, the other which expects no parameters.

c. Write code to create the objects by using the first constructor. Hard-code the data into your program - use the data from the dwarf_planet_data.csv file.

Menu option 2. List all the data you have entered into the database.
That is, all attributes for all objects.

Menu option 3. Delete the dwarf planet Eris from the database.

Menu option 4. Manually add the dwarf planet Eris back again.
This means reading all the attribute values from the keyboard. When the user has finished, the program should display the values added.

Menu option 5. Change the number of moons of Sedna to 1.
Do this by
a. Reading the new value from the keyboard
b. Changing the value in the database
c. Displaying the values of all attributes for this dwarf planet.

Menu option 6. Calculate the average (mean) diameter for the Kuiper belt dwarf planets.

Menu option 7. List the orbital radius and orbital period for a given non-Kuiper belt dwarf planet.
The dwarf planet to be used should be read from the keyboard.

Menu option 8. List names of all dwarf planets with a radius greater than a value read from the keyboard.

Menu option 9. (Challenge)
Write a Region class and instantiate an object called Kuiper. Add the three dwarf planets to it as attributes of type DwarfPlanet. When all three are added, display the values of the attributes for all three by calling a method in the Region class.

Menu option 10. (Challenge)
Implement part of the interface using GUI components.

Task. Provide a UML class diagram of your program.

Additional program requirements
The program should consist of three classes with the following names and instance variables (attributes). You may need other variables in these classes.

Class name: DwarfPlanet
name - the name of the dwarf planet
region - the region of the solar system, here we use "Kuiper belt" or "Other" only. orbitalRadius - the radius of the orbit, units Astronomical Units (AU). One AU is the
distance of the Earth from the Sun.
orbitalPeriod - the time taken to complete one orbit of the Sun, units years. diameter - the diameter of the object, units km.
mass - the mass of the object, units 1021kg
moons - the number of objects orbiting the dwarf planet.

Class name: Region
Attributes of type DwarfPlanet.

Class name: Interface
The class with the main() method.

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, which should create an instance of the class Interface, and call a method run(), which will display the menu to the user (this is provided for you in the files you should start with). This class will be the only one that takes input from and sends output to the user. It may do so using either TIO or GUI methods (your choice). A template is shown below and the file Interface.java is available for you to use.

public class Interface { private void run(){
// All your code here ...
}

// Create an instance of this class and run the code above public static void main(String[] args){
Interface infFace = new Interface(); intFace.run();
}
}

You do not need to use arrays
The use of arrays would be appropriate for this assignment, but as we have not covered arrays in the lecture material yet, you do not have to use arrays in this assignment. No additional marks will be given for the use of arrays.

Attachment:- Dwarf Planets Database.rar

Reference no: EM133107618

Questions Cloud

What is the total amount that is eligible to be capitalized : General advertising and promotional costs 10,000 and Legal fees $2,000. What is the total amount that is eligible to be capitalized
Describe three methods you would use to retain employees : Describe three methods you would use to retain employees and explain why you would use each of those methods.
What is the warranty Expense for Dec : Tyremart Inc provides a two-year warranty on winter tyres it manufactures below are the excerpts for Dec 2020 - What is the warranty Expense for Dec
What is a good research topic for covid-19 : What is a good research topic for COVID-19?
Implement an object-oriented program : Implement an object-oriented program (using Java) to manage a database of objects containing information about dwarf planets in our solar system
Who decides at lb brands : LB Brands, a Western Canada marketing company, had grown to 100 employees. Joan Farris, the Vice President of Marketing, spends much of her day developing and c
Impact on decision-making in health care : Using the internet or the University Library, research and select one article about strategic planning in health care. Make sure your article discusses market f
Prepare cash budget for hemrock ltd for august : The bank balance on 31 July 2021 is expected to be R45,000 (credit). Prepare Cash Budget for Hemrock Ltd for August
Discuss a decision that was made by your company : Please provide an example Decisions are made on a daily basis within every position at every company. Decisions regarding company policy can often create the co

Reviews

Write a Review

JAVA Programming Questions & Answers

  Object-oriented gui drawing editor

A simple object-oriented GUI drawing editor that allows a user to create, move and erase rectangles, squares, circles and lines in an interactive graphics. How can I draw move erase rectangles, squares, circles and lines in GUI/java.

  Make class called dice that has one variable called face

Now, make class called Dice that has one variable called face. This variable will be a number between 1 and 6 inclusive and will store the latest value

  Java program that prompts the user to input three numbers

Need a java program that prompts the user to input three numbers. This program should then output the numbers in nondescending order

  Command line arguments are passed to the main method

Command line arguments are passed to the main method through the array of String references (args in the main method below).

  Calculate the vertical and horizontal components of u

Calculate the vertical and horizontal components of u (the launch velocity) using the following trigonometric identities:

  Implement the client and server components

The basic requirements of this assignment are to implement the client and server components as discussed above. The basic protocol of the system is described below: The operations of the client are: SEND_SERVER_MESG: send a basic text message to th..

  Create a search function that can search for an integer

Create a "masterSort" function that will call the appropriate sort function depending on the length of the array - create a "search" function that can search for an integer in the array.?

  Write a program to print out a simplified bill

Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.

  Create a customer object and make sure it has values for all

Define Customer.java according to the following class diagram and information. Define Account.java according to the following class diagram.

  Create a java class named headphone

Create a TestHeadPhone class that constructs at least 3 HeadPhone objects. For each of the objects constructed, demonstrate the use of each of the methods.

  Minimal spanning tree decreasing edge

minimal spanning tree decreasing edge dismissalreverse-delete algorithm. develop an implementation that computes the

  Draw a flowchart to represent sequence of events in program

Pay careful attention to the size and spacing request. Write either pseudocode or draw a flowchart to represent the sequence of events in your program.

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