Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSIGNMENT 2 Assignment 2 tests your knowledge of Decisions Structures ( Chapter 4 ) , repetition structures / Loops ( Chapter 5 ) and Classes

ASSIGNMENT 2
Assignment 2 tests your knowledge of Decisions Structures (Chapter 4), repetition structures/Loops (Chapter 5) and Classes and
Objects in Java (Chapter 6) and should be solved using concepts learned in class so far (Chapters 1 to 6) and requirements bellow.
Design a class called YourNameMonth, replace YourName with your actual name) with the (exact) fields and methods ?1 :
Design a driver class called YourNameAssignment2(replace YourName with your actual name) in the same project as the
YourNameMonth. You will need to add the class Month to the project and add your code to the project class main method. The
program (code) should:
Create three objects: Month1 using the first no-arg constructor, Month2 using the second constructor with 2 as an argument,
Month3 using the third constructor with "October" as an argument, and Month4 using the fourth/copy constructor from Month3.
Use the getNumber to get the month number from objects Month1, Month2, Month3, and Month4 and output the them.
Use the getName to get the month name from objects Month1, Month2, Month3, and Month4 and output them.
Use the setNumber to set the Monthl object value to 10.
Use the toString to get the month string from objects Month1, Month2, Month3, and Month4 and output them.
Use the equals method of Month1 to compare its value with Month2 value and output the result.
Use the compareio method of Month3 to compare its value with Month4 value and output the result.
Implement the classes in NetBeans IDE and JAVA: Create a JAVA project called YourNameAssignment2(same name as the driver
class), add the class YourNameMonth to the YourNameAssignment2 project and add your code to the YourNameMonth class and
YourNameAssignmen2 project/driver class main method. Your program should be user-friendly and be well-
documented/commented (have comments for every line of code).
Create the screenshot document for your code and output: Create a Microsoft Word document from the YourName-
AssignmentN.docx template and call it YourName-Assignment2.docx (replace YourName with your actual name) with your
screenshots of the NetBeans editor window showing the complete JAVA source code for both YourNameAssignment2(Class 1) and
YourNamePet (Driver Class) classes and the complete output. If the entire class JAVA source code or the output does not fit in one
screenshot or the screenshots cannot be easily read, create multiple screenshots and add multiple screenshots to the screenshot
document. If your output is longer than a line and does not fit on one screen, Wrap Text in your output panel.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

Discuss consumer-driven health plans.

Answered: 1 week ago