CS代考 Set an alarm so that you have sufficient time to save and submit into LMS.

Set an alarm so that you have sufficient time to save and submit into LMS. Do not submit late.
Open a new MS Word file and write your answer in the MS Word file. Remember to save your file often. CLEARLY INDICATING THE QUESTION BEING ANSWERED. For coding questions, you have to also submit the NetBeans project file just like you have done for your assignments.
Answer all questions Marks for each question may be different but are indicated with the question.
Set an alarm that rings 5 minutes before the due time. You will need to submit the exam question and answer file by the due time even if you have not finished. Submission will be disabled in LMS after the due time.

Copyright By PowCoder代写 加微信 powcoder

There are no marks for regurgitation of memorised or copy/pasted code or answer when the code or answer is not relevant to the question.
For coding questions check your answer in NetBeans, just as you have done in the Labs and Assignments. You have to submit the project file, and it has to be able to be build and run to get the full mark. The marks for the question depend very much on whether your code builds and runs, so use NetBeans IDE to assist you.
Several questions depend on the work you have done in the lab and assignments. You must use only your work in this exam. Do not use anyone else’s work as the plagiarism checker will pick up similarities in the answers and this is considered cheating.
Exam marks are final ONLY WHEN a personal interview is not needed.
You can use the lecture notes, unit textbook and references as well as the other material that are permitted in the exam.
You must NOT copy/paste content from these sources as the plagiarism checker will also detect this. No mark will be allocated if you copy/paste content, unless the question asks you to copy your code and modify from it.
Do not use anyone else’s work as the plagiarism checker will pick up similarities in the answers and this is considered cheating.
As it is an online assessment that is not supervised, we reserve the right to interview you to determine your understanding of the assessable material via Blackboard Collaborate using a webcam and shared screen before any mark can be awarded. If an interview is required, we will get in touch with you.

VERY IMPORTANT !!!
Copy and paste the following declaration in your answer file before answering the question. NO EXAMINATION ANSWER WILL BE MARK IF THE FOLLOWING DECLARATION ARE NOT PRESENT IN THE ANSWER FILE
Demonstrating academic integrity in online exams requires that you:
• do not copy/paste blocks of text from external sources;
• acknowledge other people’s work or ideas where appropriate;
• ensure your exam submission is your own work; and
• do not collaborate with anyone online or in person while completing the exam.
• Failure to demonstrate academic integrity in online exams will be treated seriously
and may result in a misconduct allegation.
I declare that, apart from properly referenced quotations and citations if required, this online exam submission will be my own work and complies with ‘s academic integrity commitments and any other conditions of submission as attached to the assessment. I am aware that I am making this declaration by completing this online exam and that this is deemed equivalent to executing a declaration with a written signature.
I acknowledge that a copy of my work may be submitted to the Urkund text-matching service to assist with assessing and checking for plagiarism.
I have read and agree to the above statement.

Question 1: (30 marks)
With reference to your Assignment 1, you are to modify your submitted code to incorporate the function as described below. Make sure you copy the NetBeans project file for Assignment 1, and modify the code from there. You have to test your code first before submission.
In the modified program, you give the user the option to decide if they want to enter the coin denominations through the program or using the hard-coded coin denominations. If the user selects to enter the coin denominations manually, provide a menu item to ask the user to enter the coin denominations. For the purpose of this question, and you do not want to change too much of your coding, you should ask the user to enter only 50, 20, 10 and 5. Therefore, you need a way to validate if the user has entered the coin denominations (50, 20, 10 and 5) correctly. Use Exception Handling to deal with the validation and require the user to re-enter the correct denominations if they are wrong. Comment out the original implementation and do not delete the original code when submitting.
You have to provide your solution with the following guidelines.
• Provide a way for the user to select if they want to enter the coin denominations
manually or use the hard-coded coin denominations. (3 marks)
• Add a new menu item and method to request the user to enter the coin
denomination (5 marks)
• The use of Exception Handling to handle the input of the coin denominations. (5
• Your catch blocks should advise the user of the problems and request the user to
enter the input again, instead of ending the program. (4 marks)
• Make sure you explain and justify every line of your code for the implementation of
the Exception Handling, using internal documentation. (8 marks)
• Provide a test plan using a test table similar to the one in Assignment 2 to explain
and justify how you will test the code. You are not required to provide the actual output, just provide the Expected Output. (5 marks)
NOTE: If your project file cannot be run, you will only receive 50% of the marks of this question. Test it before submission.
Remember to submit your NetBeans Project file.

Question 2: (35 marks)
With reference to your Assignment 2, you are to modify your submitted code to incorporate the function as described below. Make sure you copy the NetBeans project file for Assignment 2, and modify the code from there. You have to test your code first before submission.
In the client class, add the following menu item.
11. Add (to the ArrayList) with new student records from a text file. In this text file, you will need to include all the information required in the Student Class, as well as the information required either in the CourseWorkStudent class or the ResearchStudent class. (you can just do one of these).
Note: Given that after the addition of the new student records, the ArrayList is not sorted, therefore the user should not be allowed to select option 10 until the ArrayList is sorted (using option 9)
You have to provide your solution with the following guidelines.
• Add the new records from an appropriate text file. It will need to be integrated into
your existing program and able to use all existing methods created in your Assignment 2 submission (for example, the added records can also be sorted using the same algorithm in menu item 9). You will have to check if the student record has already existed in the ArrayList, if yes, an appropriate message needs to be output to inform the user, and ask the user to confirm if the record needs to be added. If yes, the record will be added, and if no, the record will not be added. (7 marks)
• With the new student records added, you will need to check if option 10 can be used. (2 marks)
• Provide examples of the text file used for each case (Course Work Students and Research Students), with at least three student records. (2 marks)
• You can use the equals method for checking if the student record is already present. And you have to decide on which writeoutput method to be used to inform the user and explain why that particular writeoutput method is used. (5 marks)
• Make sure you explain and justify every line of your code using internal documentation. (5 marks)
• Provide a test plan using a test table similar to the one in Assignment 2 to explain and justify how you will test the code. You are not required to provide the actual output, just provide the Expected Output. (6 marks)
• Provide the updated structure diagram and the class diagram for the update code. (8 marks) – if you have not created one for your assignment submission, you will need to create these for this question.
NOTE: If your project file cannot be run, you will only receive 50% of the marks of this question. Test it before submission.
Remember to submit your NetBeans Project file.

Question 3: (20 marks)
Given a base class with the following UML class diagram. Create a Person base class for the following. You have to create a NetBeans project for this question.
– name: String
+ setName(String newname): void
+ getName( ): String
+ writeOutput ( ): void
+ equals (Person otherPerson): boolean
You have to use the base class Person you have created to derive a class named as Student that can be used for the objects for students in a university. The employee record will inherit a student’s name from the class person. A student record will contain the GPA score represented as a single value of type double, a starting date that gives the year that student started the course as a single value of type int, and a student identification number that is a value of type long.
You have to provide your solution with the following guidelines.
• Provide the Person Base Class (2 marks)
• You have to provide the derived Student class from Person class and take care of the
following.
• Provide appropriate private instance variables for the information required in the
derived class. (2 marks)
• Explain and demonstrate the importance of using private instance variables. (2
• Provide a default constructor and all other necessary constructors required for the
derived class. (2 marks)
• Provide all necessary mutator and accessor methods in the derived class. (2 marks)
• Provide a writeOutput and equals methods in the class Student. (2 marks)
• Using the class Student that you have created to explain the differences between
overloading and overriding methods using the methods in class Person and class
Student. (2 marks)
• Using the class Person and class Student, explain what is polymorphism and provide
an example of how you can use the two classes to illustrate the concepts of polymorphism. Note: if you just provide definition of polymorphism without using code and example for the classes to explain, you will receive 0 mark for this part. (4 marks)

• Provide a client class such that you can demonstrate the use of the derived Student class and for testing purposes. (2 marks)
NOTE: If your project file cannot be run, you will only receive 50% of the marks of this question. Test it before submission.
Remember to submit your NetBeans Project file.

Question 4: (15 marks)
There are five errors in this code. Correct the errors and make the code work. Explain what are the errors found.
import java.util.Scanner;
//Testing.java
//Displays running total of numbers in lines of standard
//input correct to two decimal places.
//Uses an out of range number(<-100 or >100) to quit.
public class TwoDPs{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double total=0;
boolean flag=true;
System.out.println(“Use an out of range entry <-100 or >100 to quit.”);
while(flag){
System.out.println(“Enter a number on a line:”);
double d = input.nextDouble();
if (outOfRange(d)){
flag=false;
dispTwoDPs(“The number value is: “,d);
total = total + d;
dispTwoDPs(“The total is: “,total);
System.out.println();
System.out.println(“Next.”);
} //end of else
}//end of while
System.out.println(“You quit.”);
}//end of main
static boolean outOfRange(double d) {
if(d>-100) return true;
if(d>100) return true;
return false;

static void dispTwoDPs(String msg, double num) {
//display on screen the message msg
//followed by num correct to two decimal places
//with both decimal values showing even if they are
//record whetherthe number is negative
boolean neg =(num > 0);
//make a positive version of the number
double posNum = num;
if(neg)posNum = – num;
//add 0.005 to the posNum, so that truncating nPlus
//is equivalent to rounding posNum
double nPlus = posNum+0.005;
//extract the whole number part and the rest
int whole = (int)nPlus;
double rest= nPlus – whole;
//multiply the rest by 100
//truncate, csat and make sure there
//are some zeros in front of small numbers
int temp = (int) (100.0*rest +100.0);
//make a string version of temp
String s = “” +temp;
int I = s.length();
String sign=””;
if(neg) sign=”-“;
//display the message, sign, whole part and last two
digits of s
System.out.println(msg +”” +sign +whole +”.”
+s.substring(l-3,l));
//end of class
End of the Paper

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com