Java problem | Computer Science homework help

 

Introduction

 

Question (1) asks that you demonstrate an understanding of simple graphics, inner classes, events and the ActionListener interface. Question (2) looks at the object-oriented programming paradigm: inheritance, interfaces, classes (including abstract classes) and instance methods.

 

IMPORTANT NOTE: Please use Java 8.

 

 

 

Electronic files you should have:

 

Question (1)

 

      RectanglesGUI.java

 

Question (2)

 

      BaseQuiz.java

 

      FreeQuiz.java

 

      MultipleChoiceQuiz.java getQuestions method only

 

      TrueFalseQuiz.java getQuestions method only

 

      Question.java

 

      FreeQuizQuestion.java

 

      MultipleChoiceQuestion.java

 

      GenericQuizClasses.pdf

 

Please ensure that you hand in electronic versions of your .java files. Class files are not needed.

 

No zip or compressed files.

 

You are asked to give your classes certain names; please follow these instructions very carefully. Make sure there is no conflict between your file name and your class name. Remember that if you give your files names that are different from the names of your classes (e.g. cwk1-partA.java file name versus RectanglesGUI class name) your program will not compile because of the conflict between the file name and the class name.

 

 

 

Compile and run the RectanglesGUI class. You should note that it uses an inner class to place a JPanel onto a JFrame. Some coloured rectangles are drawn on the JPanel:

 

Output of the RectanglesGUI class

http://nursingessayswriters.com/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Please complete the following tasks:

 

 

1.            Shorten the paintComponent (Graphics) method by rewriting the statements to draw and fill the rectangles with colour. Put the statements into a loop of your choosing. The model answer uses

 

nested for loops, and has reduced the number of statements needed to draw the rectangles to 5.

 

2.            Using getWidth() and getHeight() for the RectangleDrawPanel, distribute the rectangles evenly across the drawPanel, so that each is fully visible and so that all of the available space is used (see the image below).

 

NOTE: your solution must be scalable – that is, the dimensions of the JFrame could be changed to be bigger or smaller, and the rectangles

 

would still all be visible and fill the available space, without any other changes being made.

3.           Add a JButton to the SOUTH region of the JFrame using BorderLayout (2 marks). Set the text on the button. The text shouldinvite the user to click the button.

 

4.

 

Write an inner class called RandomColorListener to implement the ActionListener interface and to listen to the JButton in the SOUTH region.

 

NOTE: you can only get full credit for this part of the question by writing an inner class.

 

5.            When the user clicks on the JButton in the SOUTH region, the rectangles filled with color1 should all change to a random Color, while the rectangles filled with color2 should not change. A second click on the JButton should make the rectangles filled with color2 all change to arandom Color, while the rectangles filled with a random Color by the first click should stay the same Color. The user should be able to continue clicking on the button indefinitely, and with each click one set of rectangles will be filled with a random Color. In each case, the rectangles to change should be the ones that stayed the same on the last click (in other words, the Color change should alternate

 

between the two sets of rectangles). This means that with each click only one set of rectangles should change colour.

 

6.            Write a second inner class implementation of the ActionListener interface, called ResetListener. The ActionPerformed(ActionEvent) method of the class should have a means of resetting the colours of the

 

rectangles back to the colours that they were filled with at the start (orange and blue).

 

7.           Add a second JButton to the NORTH region, and add the ResetListener to it such that when the button is clicked the rectanglesare once again filled with orange and blue, as they were at the start of the program. Further clicks on the button will have no effect when the default orange and blue colours are displayed, but will reset the colours to the default setting once more if they have been changed by clicking the other button. Add an appropriate message to the

 

button telling the user what it does.

 

Output of the RectanglesGUI class, revised so that the rectangles are all the same size and divide up the available space between them.

http://nursingessayswriters.com/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reading for Question (1)

 

       See: http://docs.oracle.com/javase/7/docs/api/java/awt/Color.html for the constructors, for example Color(int r, int g, int b), that allow developers to make their own Colors.

 

       Chapter 12 of Head First Java, pages 353–81.

 

 

 

Deliverable for Question (1)

 

                      An electronic copy of your revised program: RectanglesGUI.java

Question (2)

 

In this part of the coursework assignment, you have been given the BaseQuiz and the

 

FreeQuiz classes, together with the Question, FreeQuizQuestion and MultipleChoiceQuestion classes. BaseQuiz is abstract, and FreeQuiz is one possibleconcrete class extension of it. You should compile and run the FreeQuiz class and see how it behaves. The FreeQuiz class uses FreeQuizQuestion objects, which are placed into an ArrayList of potential questions. The number of possible questions to be randomly chosen from this ArrayList and asked of the user is set in the getQuizSize() method. You might want to try changing the value (currently 5) a few times to see what happens.

 

The FreeQuizQuestion class is a child class of the Question class. The Question class specifies that the question itself will be a String, but it does not set the type of answer, which is left to the child classes. FreeQuizQuestion answers are Strings, while the MultipleChoiceQuestion class answers are more complicated. Multiple choice questionsneed a list of possible answers, and a record of the correct answer. In the MultipleChoiceQuestion class the possible answers are stored in an array, and the actualanswer is recorded as an int that holds the position of the correct answer in the list of possible answers; the list of possible answers are numbered starting at 1. Hence in the question:

 

MultipleChoiceQuestion q1 = new MultipleChoiceQuestion(“What is the primitive data type that starts with ‘i’?”, 1, “int”,

 

“INT”, “Int”, “Integer”);

 

the ‘1’ means that “int” is the correct answer.

 

You have been given the MultipleChoiceQuiz and TrueFalseQuiz classes; each contains only the populateList() method.

 

You have been given a PDF with some Generic classes. These classes,

 

GenericBaseQuiz, GenericQuestion, GenericFreeQuiz and GenericFreeQuizQuestion have been adapted from the BaseQuiz, Question, FreeQuiz and FreeQuizQuestion classes respectively.

 

 

 

Please complete the following tasks:

 

 

1.            Complete the MultipleChoiceQuiz class as a direct child class of BaseQuiz. Include a main method in your class with test statements tomake and run an instance of the class. Your completed class should behave in the same way as the FreeQuiz class, except that the questions that it is asking are multiple-choice ones. This means that the question is displayed with a numbered list of possible answers, and the user has to type in the number of the answer that they think is correct.

 

See the Appendix for an example of the output of this class.

2.            Write the TrueFalseQuestion class as a direct sub-class of the

 

Question class.

 

3.            Complete the TrueFalseQuiz class as a direct child class of BaseQuiz. Include a main method in your class with test statements to make and run an instance of the class. Your completed class should behave in the same way as the FreeQuiz class, except that the questions that it is asking are true or false. This means that the user is shown a statement and has to decide whether they think the statement is true or false,

 

typing in their answer. See the Appendix for an example of the output of this class.

 

4.            Can you explain how and why the Generic classes are different from the classes that they have been based on?

 

Consider the getRandomQuestions(List, int) method in the

 

GenericBaseQuiz class. The corresponding method was static in BaseQuiz, but is an instance method in GenericBaseQuiz. Can youexplain why?

 

You should write no more than two paragraphs in answer to this question

 

(note a paragraph is at most 8 sentences). You may give in your answer as a PDF, Word, OpenOffice or text file.

 

 

 

 

Reading for Question (2)

 

The following topics from Head First Java

 

        Object programming

 

        Object behavior

 

        The Java library

 

        Inheritance

 

        Abstraction

 

Reading for Question 4:

 

        https://docs.oracle.com/javase/tutorial/java/generics/

 

 

 

Deliverables for Question (2)

 

Please hand in an electronic copy of the following:

 

      Your completed MultipleChoiceQuiz.java

 

      TrueFalseQuestion.java

 

      Your completed TrueFalseQuiz.java

 

      A PDF, Word, OpenOffice or text file with your answer to Question (2) Part 4(b).

Appendix

 

Sample output of the completed MultipleChoiceQuiz class (questions randomly chosen)

 

This quiz has 3 questions. Good luck.

 

QUESTION (6 possible answers): What is the minimum value of the byte data type?

 

1.  -63

 

2.  -64

 

3.  -127  4. -128  5. -255

 

6.-256

 

Enter a number> 4

 

 

QUESTION (3 possible answers): What is the value of the expression “James”.charAt(“James”.length() – 1) ?

 

1.  no value, run-time error

 

2.  e

 

3.  s

 

Enter a number> 3

 

 

QUESTION (6 possible answers): What is the maximum value of the byte data type?

 

1.  63

 

2.  64

 

3.  127  4. 128  5. 255

 

6.256

 

Enter a number> 3

 

 

You scored 3/3. That’s 100%. Excellent!

 

 

 

 

 

 

Sample output of the completed TrueFalseQuiz class (questions randomly chosen)

 

This quiz has 5 questions. Good luck.

 

True or false? Static methods can operate on instance variables; true

 

True or false? Instance variables hold the same value for every instance of the class; true

 

True or false? Static methods can be run before an instance of the class is made; true

True or false? Java is case sensitive; true

 

True or false? The following expression type checks: int x = “elf”.compareTo(“7”)+11; false

 

 

You scored 2/5. That’s 40%. You’ll have better days.

CEU program for Family Nurse practitioner

Question description

Write substantive response of 200 words to the question below and include in-text citation. APA format.
References and citations should conform to the APA 6th edition.

The FNP must maintain his or her license to practice. In order to obtain and maintain your license, you must be certified. An important requirement for maintaining your license and certification is obtaining the specified ANCC Continuing Education Units (CEU). It is important for FNPs to keep up with continuing education. They must maintain at least 75 CEUs. Identify at least two approved ANCC CEU providers. Give an example of each CEU program. Discuss at least one other method of obtaining CEU credits than attending workshops, seminars, and conventions.
Part B.
Respond to other student’s responses with substantive comments. Substantive comments add to the discussion and provide your fellow students with information that will enhance the learning environment.The postings should be at least one paragraph (approximately 100 words) and include references.
Sandra’s Response
There is general agreement that nurses must acquire and maintain the specialized knowledge needed to provide highly skilled care and to demonstrate their competence to the public, their employers, their profession, and patients on an ongoing basis throughout their work lives. Nurses report that continuing nursing education is the third most vital component of nursing skill building. Nurses from states that mandate continuing nursing education, as well as those from states that do not, rank continuing nursing education just after their workplace experience and their basic nursing education in importance. Continuing education units are required by different professions as well as nursing to keep up with updated information regarding practice guidelines, laws, and research among other valuable pearls of knowledge that help the profession distinguish itself from others. Two approved ANCC CEU programs that I found are the AANP and NPACE.

The American Association of Nurse Practitioners (AANP)- The CE Opportunities Calendar provided on the website features hundreds of current AANP-accredited programs, listed by date, with city, state and contact information for each activity. It also includes an updated listing of AANP-Approved Providers of continuing education for NPs.
The Nurse Practitioner Associates for Continuing Education (NPACE)– Founded in 1980, Is a non-profit organization based in the United States that provides continuing education to Nurse Practitioners and Advanced Practice Clinicians. This organization puts together seminars annually around the United States with qualified guest speakers that have been in the field for numerous years and that have experience in public speaking, research, and a multitude of specialties.

For those seeking CEU credits but are limited in traveling there are online webinars available, audiovisual programs, and monographs. In addition, online CE courses in a variety of specialty focuses and topics are available through the AACN. Moreover, there are always many opportunities to obtaining CE through publications and Journals as well.
References
The American Association of Nurse Practitioners (2018) Retrieved from https://www.aanp.org/education/continuing-education-ce/ce-opportunities
The Nurse Practitioner Association for Continuing Education (2018) Retrieved from http://npace.org/online-ce/
Whitehead, T. D., & Lacey-Haun, L. (2008). Evolution of accreditation in continuing nursing education in america. The Journal of Continuing Education in Nursing, 39(11), 493-9; quiz 500-1, 516. Retrieved from https://prx-herzing.lirn.net/login?url=https://sea…
Stephen’s Response
The American Nurses Credentialing Center approves CE providers to issue continuing education to nurse practitioners in order for them to meet the 75 CE requirement of their license. The ANCC website makes finding approved providers easy. Two providers of CE that were generated by the website were The American Academy of CME and the American Association of Heart Failure Nurses (ANCC, 2018). The first one is a not for profit medical education company and offers CE classes like “CME Challenge An Interactive Session to Test Your Compliance Radar” and “Survey Says…Making Wise Choices About Compliance Today to Avoid Accreditor’s Regret Tomorrow (AACME, 2018).” The second is a professional nurses education that has multiple programs in research and patient education as well as CE offerings. An example of a course from this group is “pulmonary Hypertension Management (AAHFN, 2018). Other then workshops, seminars, and conventions, the NP can earn CE from the comfort of their own home. A number of organizations offer online multimedia CE that is text or video based. Examples of these organizations are the American Association of Nurse Practitioners, Advanced Practice Education Associates, and the Nurse Practitioner Association for Continuing Education (Decapua, 2016).
References
AACME. (2018, January 4). AACME partners in education. Retrieved from https://www.academycme.org/
AAHFN. (2018, February 17). American Association of Heart Failure Nurses. Retrieved from https://www.aahfn.org/default.aspx.
ANCC. (2018, January 1). Find an accredited organization or program. Retrieved from https://www.nursingworld.org/organizational-programs/accreditation/find-an-accredited-organization/.
Decapua, M. (206, February 15). 6 great sources for NP continuing education. Retrieved from https://www.healthecareers.com/article/education/6…
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Excel vba project due in a few hours

 You’re being provided with a 10 year data set of weather data of min max temperatures and rainfall as collected at Raleigh-Durham International Airport by NOAA. – The data set contains the dates of readings in oF, and rainfall in inches – Dates are in generic number format with 1/1/2007 = 39083 – Dates are non-sequential • Construct an Excel solution that evaluates the data set and finds the following. – The average monthly temperatures. – Total monthly rainfall 

Below is the Dataset

In M2 Assignment 1, you proposed a Fitness-for-Duty Evaluation (FFDE) for a police department. In this assignment, you are to create a comprehensive, well-researched FFDE proposal based on the followi

In M2 Assignment 1, you proposed a Fitness-for-Duty Evaluation (FFDE) for a police department. In this assignment, you are to create a comprehensive, well-researched FFDE proposal based on the following scenario.

Scenario:

A midwestern state police department recently responded to a barricaded active shooter incident where the shooter had confined himself and his family to their home. The negotiator was able to persuade the shooter to release his four young children but was unable to persuade the shooter to release his wife or surrender. The scenario resulted in the suicide of the active shooter in front of his spouse, who remained unharmed.

You are the mental health consultant for the police department. You have been assigned to conduct an FFDE on the negotiator, a thirty-five-year-old white male. The negotiator is a seven-year veteran of the force who has three small children and is going through a divorce. Although the officer appears to be handling the stress well, a closer examination reveals that the negotiator shows signs of depression and anxiety, which were not present prior to the incident.

Tasks:

Using at least two scholarly resources from the professional literature, investigate methods for developing FFDEs. The literature may include the Argosy University online library resources, relevant textbooks, peer-reviewed journal articles, and websites created by professional organizations, agencies, or institutions (.edu, .org, and .gov).

Create a 6- to 8-page Microsoft Word document by addressing the following:

Design an appropriate fitness-for-duty assessment for the negotiator, which will be submitted to your client and the police department. The plan should, at a minimum, include the following:

Paperwork: You should review before you commence your evaluation. Remember that you may want to consider who is making the referral and why.

Psychometric instruments and a justification for using them.

Clinical semistructured interview questions that are sensitive to issues of culture and ethics. Consider developing rapport with the officer before you lead into the sensitive questions pertaining to the referral.

Effects of symptoms of depression and anxiety on an officer’s ability to perform his or her duties.

Any treatment, if recommended, for symptoms of depression and anxiety in a law enforcement officer.

Create a clinical fitness-for-duty written evaluation outline. Include aspects of cultural and ethical standards, valid and reliable instruments, and the recommendations of your evaluation, including, but not limited to, treatment recommendations and firearm retention.

Provide an introduction paragraph to the client and use section headers.

Apply APA standards to cite sources.

Submission Details:

  • Save your assessment report as M3_A2_Lastname_Firstname.doc. By the due date assigned,post it to the Submissions Area.

 

“Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code “Newclient”

The post In M2 Assignment 1, you proposed a Fitness-for-Duty Evaluation (FFDE) for a police department. In this assignment, you are to create a comprehensive, well-researched FFDE proposal based on the followi appeared first on Psychology Homework.