Demonstrate the use of all of your constructors

Assignment Help JAVA Programming
Reference no: EM133364994

Question One

You should complete this question in week one.

Your activity is to complete the QuestionOne class. In the class, you must:
Have at least four instance variables of different data types, with at least one primitive and one wrapper.
Make use of constructor overloading i.e. Have more than one constructor.
Have accessor (getter) and mutator (setter) methods for ALL instance variables.
Have a method that prints the contents of all of the instance variables. The output must be formatted for readability. For example if you have an instance variable called age that has a value of 7 you might print something like The age is 7.
Have a method with an if-else statement that takes uses the value of one of the instance variables in the condition and prints a message based upon the value.
You must complete the following in the main method:
Demonstrate the use of all of your constructors i.e. use each constructor in the class to create a QuestionOne object.
Demonstrate the use of an accessor method i.e. use one of the accessor methods from one of the objects you just created.
Demonstrate the use of an mutator method i.e. use one of the mutator methods from one of the objects you just created. .
Demonstrate the use of the method that prints the contents of all of the instance variables i.e. use the print method from one of the objects you just created.
Demonstrate the use of the method with the if-else statement i.e. use the method with the if-else statement from one of the objects you just created.
Make sure you:
Add class comments, with your name as author and date as the last date you worked on this exercise.
Add comments to describe the instance variables and methods in the class.
Name all variables and methods as per Java naming conventions.

Question Two
You should start this question in week one and finish it in week two.

Your activity is to complete the QuestionTwo class. In the class, you must:
Declare an Array of data type double and insert at least five values to the Array.
Loop through the Array and for each element (double value that you inserted) in the Array, print the following formatted for readability:
The index of the element.
The absolute value of the element (hint - you will need to use one of the methods from the Math class covered in module 1).
The value of the element rounded up to its nearest integer (hint - you will need to use one of the methods from the Math class covered in module 1).
The value of the element rounded down to its nearest integer (hint - you will need to use one of the methods from the Math class covered in module 1).
The square root of the element (hint - you will need to use one of the methods from the Math class covered in module 1).
The result and remainder when the element is divided by the number of elements in the Array i.e. an int that is equal to the size of the Array (hint - you will need to use the division and modulus operators covered in module 1).
Please note that the above must print when the main method runs. How you do this is up to you. You can write all of the code in the main method for this question if you like.
Make sure you:
Add class comments, with your name as author and date as the last date you worked on this exercise.
Add comments to describe the instance variables and methods in the class.
Name all variables and methods as per Java naming conventions.

Question Three
You should start this question in week two.

Your activity is to complete the QuestionThree class. In the class, you must:
Declare an Array of data type String as an instance variable.
Initialize the Array. Generate a random number and use the random number as the Array size. You do not need to add elements to the Array when initializing it (hint - you can do this in the constructor. Generating random numbers is covered in module 1. If you can not do this then you can give the array a size of your choosing).
Have a method that takes a parameter and adds the parameter to the Array. A suitable error message must be given if the Array is full.
Have a method that sorts the Array.
Have a method that prints all of the elements in the Array.
Using the methods that you wrote, you must do the following in the main method:
Create an object of type QuestionThree.
Use the method that you wrote to add at least five elements to the Array.
Use the method you wrote to print all of the elements in the Array.
Use the method you wrote to sort the Array.
Use the method you wrote to print all of the elements in the Array again to demonstrate that the sort method you wrote successfully sorted the Array.
Make sure you:
Add class comments, with your name as author and date as the last date you worked on this exercise.
Add comments to describe the instance variables, and methods.
Name all variables and methods as per Java naming conventions.

Verified Expert

In this project Created three java files.In the first Java file, constructors, mutators and accessors.In the second Java file created the array of double and various Mathematical methods,Randomly generated input size for arrays and added elements to array.

Reference no: EM133364994

Questions Cloud

Discuss the likely effects on labor force participation : Draw the current daily budget constraint (assume a wage that is net of the hourly child-care costs) for a single mother and then draw in the new constraint.
Analysis of project management leadership styles : What are the salient considerations in the selection of an appropriate Project Manager for IT driven transformational project?
Steer negotiations between labor and management : How could you help steer negotiations between labor and management, so the conflict between them is healthy and productive? Is it even possible?
What will be the total output of the industry and the price : Assume that in equilibrium before trade, there are 20 firms, each firm producing 20 units What will be the total output of the industry and the price of output?
Demonstrate the use of all of your constructors : Demonstrate the use of all of your constructors i.e. use each constructor in the class to create a QuestionOne object
How many total meals are cooked by co-op members : How many total meals are cooked by co-op members? How many total parties are thrown by the co-op? Justify your answer mathematically.
Recall some of your more interesting projects : Recall some of your more interesting projects and think of times when there was a misalignment between what was formally presented as the set of requirements
What is role or importance of supply chain generally : What is the role or importance of Supply chain generally.
Regarding team communication and collaboration : Regarding team communication and collaboration, what are the challenges in managing a virtual team in adopting a change management process using agile?

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