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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

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

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