Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction to Java for C + + Programmers JAC 4 4 4 Please read the following guidelines very carefully before answering any questions: You will
Introduction to Java for C Programmers
JAC
Please read the following guidelines very carefully before
answering any questions:
You will at least define a class with the main method for each question.
You must keep the class name requested in each question.
You must hold the naming conventions requested in this document
and each question.
All deliverables are defined at the end of this document. You must
upload them as requested.
Class Name: MyInteger, Java File Name: MyInteger.java
Design and write a class named MyInteger. The class contains:
An int data field named value that stores the int value represented
by this object.
You must encapsulate data.
A noarg constructor that creates a default MyInteger object.
A constructor that creates a MyInteger object for the specified int value.
MyInteger int newValuedots
A getter method that returns the int value
The methods isEven and isOdd that return true if the value in this object is even or odd.
The static methods isEvenint and isOddint which return true if the
specified value is even or odd.
The static methods isEvenMyInteger and isOddMyInteger which return
true if the specified value is even or odd.
The methods equalsint and equalsMyInteger that return true if the value in this object is equal to the specified value.
In the main method, write a testing program that tests all methods in the class. Points
Class Name: Triangle, Java File Name: Triangle.java
Design and implement a class named Triangle that extends GeometricShape See the sample codes for this class The class contains:
Three double data fields named side side and side with default values
and denote three sides of a triangle.
You must encapsulate data.
A noarg constructor that creates a default triangle.
A constructor that creates a triangle with the specified side side and side
The accessor methods for all three data fields.
A method named getPerimeter that returns the perimeter of this triangle.
Perimeter: p side side side
A method named getAreathat returns the area of this triangle.
Area: asqrtppsidepsidepside
Square Root method in Java: Math.sqrt
A method named toString that returns a string description for the triangle.
For example, if we have a triangle with the following sides the toString method must return:
Triangle: side side and side
In the main method, write a testing program that prompts the user to enter three sides
of the triangle, a colour, and a Boolean value to indicate whether the triangle is filled.
The program should create a Triangle object with these sides and set the colour and
filled properties using the input. The program should display the area, perimeter,
colour, and true or false to indicate whether it is filled or not. Points
Deliverables:
A Create an up to minute video only ONE video for all the questions
explaining your answers, upload it on YouTube, and submit the link of your
video on Blackboard.
See "How to make a video and upload it on YouTube?" under the "Course
Information" on Blackboard.
Your video must at least contain the following content:
a Explaining the kev components of your code and how thev work.
b Showing three different runs and outputs of your code for each
question.
Note: There is no mark if you just read your code. You must explain your code, not read it
Note: Please DO NOT upload the original video file on Blackboard.
B You must upload all requested Java files iejava" as they are.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started