PROG2007 Programming II Assignment

Assignment Help JAVA Programming
Reference no: EM132850587

PROG2007 Programming II - Southern Cross University

Your task is to complete various exercises in BlueJ, using the Java language, and to submit these via the MySCU link created for this purpose.

Marking criteria includes:
• Use of correct coding style, including the use of comments;
• Accuracy of coding;
• Use of suitable coding structures;
• Correct submission and naming conventions of assessment items as required.
Please note that all instructions in this assignment must be followed EXACTLY, including the names you are instructed to use. Failure to do so will result in a loss of marks. The reason for this is as a programmer, you will often work as part of a team and will be required to follow design documentation. If the design parameters are not followed precisely, bugs will be introduced into the software when all of the individual components of the program are assembled.

Assignment Q1

To be completed in week 1

Create a new Microsoft Word document and call your document as YourFirstNameLastName- A1Q1.docx.
Open the house project from chapter 1 of the reference book projects. Open the terminal window and record method calls.
Create a picture with at least six (6) objects (circle, square, triangle, and person), recording all method calls.
Take a screenshot of your picture and add it to the word document you created earlier. Then copy the list of method calls needed to create the picture and paste them in the word document after the screenshot.
Add your name and student ID in the footer of the word document, as well as "PROG2007 Assignment 1 Q1".

Assignment Q2

To be completed in week 2

Create a new BlueJ project called YourFirstNameLastName-A1Q2. Create a class called Employee.
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.
Add definitions for the following fields:

• A name field of type String
• An employeeId field of type int
• A wage field of type double
• A fullTime field of type boolean
Write a constructor for your Employee class that takes four parameters - the first of type String called myName, the second of type int called myEmployeeId, the third of type double called myWage, and the fourth of type boolean called isFullTime. Set the initial values of the corresponding fields using the constructor.
Write an accessor method called getName that returns the value of the name field.

Write a mutator method called setEmployeeId that takes a single parameter of type int and sets the value of the employeeId field.
Work out what other accessor and mutator methods would be useful for this Class and add them. You should be able to get and set all fields in the Class.
Write a method called printDetails, which prints out all the details of an Employee object. You must take into account the fullTime status and print a line saying either that the employee is fulltime or the employee is not fulltime.

Assignment Q3

To be completed in week 3

Create a new BlueJ project called YourFirstNameLastName-A1Q3.

Create a class, Assignment, that contains the following four fields:

• A String called StudentName
• A double called assignmentMark (which will store the mark each assignment is worth
e.g. for this assignment that you are doing right now the value would be 20)

• A double called studentMark (stores the mark the student gets in the assignment e.g. 15)
• A String called grade
Make sure you write a description of your new Class in the comments, with your name as author and give the version as the date you last worked on this exercise.
Define a constructor that takes and sets the studentName, studentMark and
assignmentMark.

Also define a constructor that takes no parameters and sets the assignmentMark to 100.

Create an accessor and mutator for studentMark. The mutator should not let the studentMark be set a value greater than the assignmentMark (as the student cannot get a mark higher than the assignment is worth) or less than 0. If the user tries to set a value that is not valid a suitable error message should be displayed.
Create a method that calculates the grade for the student. You will need to work out how many percent the student scored in the assignment.

Assignment Q4

To be completed in week 4

Create a new BlueJ project called YourFirstNameLastName-A1Q4.

Create a class called ListOfNames, that has one ArrayList field called names, which holds a collection of Strings (each string is a male or female name in Upper case e.g. PETER).

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

Define a constructor that initialises the ArrayList. Note that you can also 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. Add a test for all three of these methods to check whether the operation was successful and print a message letting the user know if it was or was not.
Create a method called printNames. This method should loop through the collection and print out the elements (each String on a new line) as determined by the following rules:

• If the string contains any vowels (A, E, I, O and U), the method should print "The name " + the value of the String + " contains vowels, and the vowels are:" + list of the vowels in the string. The string may have more than one vowels. For example, if the name is EMMA it would print: The name EMMA contains vowels, and the vowels are: E, A
• If the string contains duplicate characters, the method should print "The name " + the value of the String + " has the following duplicate character(s):" + list of the duplicate characters in the string. The string may have one or more duplicate character. For example, if the name is ANNABELLA, it would print: The name ANNABELLA has the following duplicate character(s): A, N, L
• If the string contains any vowels (A, E, I, O and U), and it has duplicate characters, the method should print "The name " + the value of the String + " contains vowels and has duplicate characters". For example, if the name is LARISSA it would print: The name LARISSA contains vowels and has duplicate characters.
• If none of the above criteria is met, then the method should print the String element in lower case. For example, if the name is SKY, it would print: sky
Once you have finished your project, open the terminal window in BlueJ and turn on record method calls. Create a new ListOfNames object, and then add at least ten (10) Strings using the add method you wrote. You must have:

• A String that contains vowels
• A String that has duplicate characters
• A String that contains vowels and has duplicate characters

Demonstrate removing an element using the remove method you wrote, and then find the number of elements using the method you wrote that gets the number of elements. Finally, run your printNames method.
Copy all your calls into a text file called YourFirstNameLastName-A1Q4-example.txt and save it in your BlueJ project folder.

Assignment Q5

Part A:

Imagine you need to write a program for a 24-hour clock with hours, minutes and seconds. Write a Java program in BlueJ with a method that prints all possible times the clock could display starting at 00:00:00 through to 23:59:59 when all the three numbers are the same (e.g. 01:01:01, 02:02:02, 13:13:13 and so on)

Part B:

Write a second method that takes three (3) parameters - hours, minutes and seconds. This method will print out all of the possible times the clock could display from one hour before the time passed to the method till one hour after the time passed to the method when all the three numbers are even (e.g. 12:20:00 or 12:20:02, NOT 12:20:01). For example:

If the method was passed the following values: Hour = 11
Minutes = 23

Seconds = 44

The method would print all the times the clock could display from 10:23:44 until 12:23:44 when all the three numbers (hours, minutes and seconds) are even. The first printed time would be 10:24:00, and the last one would be 12:22:58)

Attachment:- Programming Assignment.rar

Reference no: EM132850587

Questions Cloud

Development of social and political attitudes on terrorism : Identify the role of three major religions in the development of social and political attitudes on terrorism
Discuss options in the job market based on educational level : Review the IOM Future of Nursing Recommendations for achieving higher levels of education. Describe what professional certification and advanced degrees
Compute the correct final balance of inventory : Inventory items with a cost of $2,880 were included in ending inventory. Using the information given above, compute the correct final balance of Inventory
Discuss results from appendix a in crucial accountability : Discuss your results from Appendix A in Crucial Accountability. What confrontations do you typically avoid or instigate? Do you use tricks to talk yourself.
PROG2007 Programming II Assignment : PROG2007 Programming II Assignment Help and Solution, Southern Cross University - Assessment Writing Service - Write a constructor for your Employee class
Cyber-stalking and cyber-harassment : How has technology influenced the act of stalking? What are some preventive measures individuals can take to avoid cyber-stalking and cyber-harassment?
Calculate the bond price : Consider a zero-coupon bond with face value of US$1,000 and with a YTM of 6%? Using Method 1 (Bond Pricing Formula) calculate the bond price
Describe the quality improvement organization : Describe the Quality Improvement Organization (QIO) and explain how the QIO improves policies and healthcare for Medicare beneficiaries.
Find out the WACC based on book values : XYZ Industries has three sources of capital - the equity shares, preference shares and straight debt, Find out the WACC based on book values

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write an algorithm method for telling if l and m store

Write an algorithm method for telling if L and M store the same sequence of elements (but perhaps with different starting points)

  What is the limit of nesting possible

IF statements can be nested -- that is, one (internal) IF statement within another (external) IF statement. What is the limit of nesting possible?

  Write a class that implements an ordered list of strings

In this problem you will write a class that implements an ordered list of Strings.

  Write a program that prompts a user to enter a us dollar

Write a program that prompts a user to enter a US dollar amount. Output a table similar to the one in the example below. The second prompt should ask the user to enter a 1 to convert to euros, a 2 to convert to pounds and a 3 to convert to ruble..

  Program that allows the user to enter the last names

Write a program that allows the user to enter the last names of 5 candidates in a college election and the votes received by each candidate. The program should then output each candidates name, the votes reveived by that candidate

  In this project you need to write a java program called

in this project you need to write a java program called mm.java to perform matrix multiplication. your code will read

  Story board of the website design

Web design capabilities in other topic (not mentioned here), prior approval from the lecturer is needed - create a website of at least 5 pages

  Java test program

Write a Java test program, all your code should be in the main method, that determines what type of organization is indicated by a web address. Your program should allow the user to enter a web address

  Create a method named justsold that increments the hotdogs

Finally, add a static variable that tracks the total number of hotdogs sold by all hot dog stands and a static method that returns the value in this variable.

  Java program that simulates the battle between a cat & mice

Mice have a chance to reproduce as long as required conditions are met. Reproduction only happens when mice are over 1, and 1 of each sex is present.

  Write class encapsulating the concept of weather forecast

Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.

  Java program that asks the user for 100 values

Write a Java program that asks the user for 100 values (or generates these randomly) and stores and displays only the distinct values. Hint: use an array to store and display these values.

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