ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 29 Apr 2017 My Price 9.00

CST141 Project 3: Chapter 10

Anyone an expert with Java language? If so, you're help would be greatly appreciated!

 

 

CST141 Project 3: Chapter 10
The MyPoint Class In BlueJ create a new Java project named "project-3" with two classes, MyPoint.java and Main.java: Select one of the following full or partial credit projects as per the instructions in the textbook
for Exercise 10.4: 10.4 - (The MyPoint class) Design a class named MyPoint to represent a point with
x- and y-coordinates. The class contains:
â–  The data fields x and y that represent the coordinates with getter
methods.
â–  A no-arg constructor that creates a point (0, 0).
â–  A constructor that constructs a point with specified coordinates.
â–  A method named distance that returns the distance from this point to a
specified point of the MyPoint type.
â–  A method named distance that returns the distance from this point to
another point with specified x- and y-coordinates. The full credit assignment is to complete the MyPoint class exactly as per the
instructions in the textbook with both distance() methods (maximum grade for
completing this full credit project is 10; out of ten (10) points)
o The formula for calculating the distance between two points given the x- and ycoordinates of both points is shown in the image below: o Hint: Check the Math class from the Java API libary to find a method that
returns the square root of a number As an alternative assignment, for the MyPoint class only include the second distance()
method, the one that takes two ints and returns the distance from this point object to
that of the x- and y-coordinate parameters (this is a partial credit assignment--maximum grade for completing the project with this modification is 9; out of ten (10) points)
o Use the same formula for calculating the distance between two points given the
x- and y-coordinates of both points as specified above If you feel that the formula to calculate the distance between two points is too
complicated, you may eliminate both distance() methods from your MyPoint class for an
additional one (1) point deduction (maximum grade for completing the project with this
modification is 8 out of ten (10) points) Additional instructions for any of the MyPoint class options: The two instance variables, x and y, are both type double There should be two constructors, the first which makes a call to the this constructor
and creates a default object with default values; call the set methods from the
constructor that takes parameters In the set methods use the this reference for instance variables with matching
parameter names; there is no validation required for x and y since negative values are
valid for both coordinates All statements in the class that reference data members (e.g. in the distance() and
toString() methods) should call the get methods of the classes (do not reference data
members directly) Include a toString() method that returns a String representation of the class which
should be a formatted representation of the x and y coordinates in the format (assuming
x = 10 and y = 5): MyPoint coordinates: x = 10.0; y = 5.0 Within class Main in the main() method include the following test operations:
o Instantiate an object of the class using the no-parameter constructor; for the full
credit version with the distance() method that takes another point of the
MyPoint type, it will be necessary to instantiate two objects o Use the showInputDialog() method of class JOptionPane to input values for the
instance data fields and pass them to the class's set methods; for the full credit
version, it will be necessary to input values for and call the set methods of the
two objects o Use the showMessageDialog() method of class JOptionPane to display the return
value of the toString() method of the object (or toString() of both objects if you
complete the full credit version); additionally in the the showMessageDialog()
call the apppropriate distance() method with a descriptive label depending upon
which version of the project you are completing; for example: MyPoint coordinates: x = 10.0; y = 5.0
MyPoint coordinates: x = 13.0; y = 9.0
Distance: 5.0 Document all classes using the Javadoc standard by including: A substantive comment statement that describes the application's purpose, as well as
substituting your name for the existing @author comment and the assignment due date
for the @version comment that already exist at the top of the new class Entering a substantive comment before each method (including the constructor) to
describe its function along with @parameter and @return tags Draw the UML diagram for the class as specified in the textbook; it is suggested
that you do this before you begin to create the class as this should make the
coding much easier; the instructor will not give you any help with your project
until the UML diagram is completed. When all steps are finished, you will submit two Java files, the "MyPoint.java" class file and the
"Main.java" file that contains the "test" program with the main() method Students may work on all projects in groups of two and both may submit the same project. If
you do work with a teammate, both students must submit the project to their own dropboxes in
Blackboard. In the text box's dropbox you should state that you worked with another student
and identify the name of that student. The completed project with a copies of class files (the .java files) along with the UML diagram
submitted electronically via attachments to a Blackboard dropbox is due to Prof. Struck by 11:59
p.m. on the date specified in the course outline.

Attachments:

Answers

(11)
Status NEW Posted 29 Apr 2017 05:04 AM My Price 9.00

-----------

Not Rated(0)