CSC72003 - Programming Assignment - Java BlueJ

Assignment Help JAVA Programming
Reference no: EM132460746

CSC72003 - Programming Assignment - Java BlueJ, Southern Cross University, Australia

Your task is to complete various exercises in BlueJ, using the Java language.

Assignment Questions -

Question 1 - [From Topic 1]

Open the house project from Topic 1. Open the terminal window and record method calls.

Create a picture with at least 6 objects, recording all method calls.

Take a screenshot of your picture and add the pasted list of method calls needed to create the picture.

Your work should be in a Word document, with your name and student ID in the footer, as well as "CSC72003 Ass 1 Q1". Call your document by your username_Q1.docx. Save this document in a folder called username_A1. For example, my folder would be called rmason10_A1.

Question 2 - [From Topic 2]

Create a new BlueJ project called your username-A1Q2. For example, mine would be rmason10-A1Q2.

Click on New Class and give the class a name of Person. Make sure "Java" and "class" are selected.

Write a description of your new Class in the top comments. Make sure you put in your name as the author and give the version as the date you last worked on this exercise.

Add definitions for the following fields:

- a name field of type String

- an age field of type int

- an eyeColour field of type String

- a boolean field called canDrive

Write a constructor for your Person class that takes two parameters - the first of type String called myName, and the second of type int called myAge. Set the initial values of the Person class's fields, using the constructor.

Write an accessor method called getName() that returns the value of the name field.

Write a mutator method called setAge() that takes a single parameter of type int and sets the value of the age field.

Work out what other accessor and mutator methods would be useful for this class and add them.

Write a method called printDetails, which prints out all the details of a Person object. For example: if the name field holds the value "Helen" then the printDetails would print (in part):

The name of this person is Helen.

Take into account the canDrive status. The printDetails() method should print a line saying either that the person can drive, or the person cannot drive.

Question 3 - [From workshop Topic 3]

Create a new BlueJ project called your username-A1Q3. For example, mine would be rmason10-A1Q3.

Create a class, Heater, that contains four fields, temperature, increment, max and min, all of whose type is double.

Make sure you write a description of your new Class in the comments, with your name as author and date as the last date you worked on this exercise.

Define a constructor that takes and sets the min, max and sets the temperature to 20.0, and increment to 1.0.

Also define a constructor that takes no parameters. The temperature field should be set to the value of 20.0 in this constructor, increment to 1.0, and maximum and minimum to reasonable amounts.

Define the mutators warmer and cooler, whose effect is to increase or decrease the value of temperature by the increment respectively.

The mutator methods should not let the temperature be set to a value higher than max, or lower than min. Add a mutator method that sets the value of the increment. Make sure you add a check to make sure that unrealistic values are not passed to this mutator method.

Define an accessor method to return the value of temperature.

Question 4 - [From workshop Topic 4]

Create a new BlueJ project called your username-A1Q4. For example, mine would be rmason10-A1Q4. Create a class, FBNames, which has one ArrayList field called names, which holds a collection of Strings.

Make sure you write a description of your new Class in the comments, with your name as author and date as the last date you worked on this exercise.

Define a constructor that initialises the ArrayList. Note that you can add any other initialisations that you feel are relevant.

Create methods to add elements, remove elements and get the number of elements in the collection. Make sure you add tests for errors and sensible error messages.

Create a method called printFizzBuzz(). This method should loop through the collection, and print out the elements (each String on one line).

If the String starts with a, e, i, o or u, instead of printing the String, it should print "Fizz" on the line. If the String starts with A, E, I, O or U, instead of printing the String, it should print "Buzz".

For example, if the collection contained the names "banana", "Apple", "orange", "pear", "peach", "kiwi fruit", "Grape", then the printout would look like:

banana

Buzz

Fizz

pear

peach

kiwi fruit

Grape

Once you have finished your project, open the terminal window in BlueJ and turn on record method calls. Create a new FBNames class, and then add at least 11 Strings. Make sure you don't use the same collection as my example.

Demonstrate removing an element, and then find the number of elements using your methods. Finally, run your FizzBuzz method. Copy all your calls into a text file and save it in your project folder.

Question 5 - [From workshop Topic 5]

Part A: Imagine you need to open a standard combination dial lock but don't know the combination and don't have a pair of bolt cutters. Write a Java program in BlueJ with a method that prints all possible combinations, so you can print them on a piece of paper and check off each one as you try it. Assume the numbers on each dial range from zero to thirty-six and three numbers in sequence are needed to open the lock.

Part B: Suppose the lock isn't a very good one and any number that's no more than two away from the correct number in each digit will also work. In other words if the combination is 17-6-32, then 18-5-31, 19-4-32, 15-8-33 and many other combinations will also open the lock. Write another method that prints out a minimal list of combinations you would need to try to guarantee opening the lock.

Attachment:- Java BlueJ Programming Assignment File.rar

Reference no: EM132460746

Questions Cloud

What are the type i and two decision errors costs : What are the Type I and Two decision errors costs? Which decision error is more likely to be discovered management?
What does it mean to be an sec accredited investor : What does it mean to qualify for 1202 treatment of your investment?What does it mean to be an SEC accredited investor?What does it mean to qualify for 1244
Make major organizational structural changes : Imagine that you have just acquired a company, are the new CEO, and have decided to make major organizational structural changes
Individualistic culture and collectivist culture : Argue that basic culture can be divided between Individualistic culture and Collectivist culture.
CSC72003 - Programming Assignment - Java BlueJ : CSC72003 - Programming Assignment - Java BlueJ, Assessment Help and Solution, Southern Cross University, Australia. Create a picture with at least 6 objects
Political system and legal system and itentlfy difference : Define a political system and a legal system and itentlfy the difference. Also define an economic system. Describe the basic types of political systems
Monopoly power of the music industry : How does the government control the monopoly power of the music industry?
How did eli lilly test its pharmaceuticals : Which organizational layer can be said to generate specific plans and instructions from broad directions?Which is NOT a requirement for a facility
What is a business process management : There are many definition of BPM and is difficult to pinpoint as to exactly what is BPM. But, BPM should be viewed as a discipline, a comprehensive methodology

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