CMPS 260 Programming Assignment #6

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Assignment Description  1. First, create an Intellij Java project and name it “pa6_your-id”. 2. Add this import to Main.java: import java.util.ArrayList; 3. Then (a) Create two ArrayList instance objects and the related reference variables. (b) Ask the user for the number of strings to place in the first ArrayList and, in turn, have the user enter that number of strings and place their references in the first ArrayList. (c) Ask the user for the number of strings to place in the second ArrayList and, in turn, have the user enter that number strings and place their references in the second ArrayList. (d) Create a third ArrayList instance object and related reference variable. Then, write the Java code to copy all of the strings referenced that appear in both of the two original ArrayList instance objects into the third ArrayList instance object. (e) Create a fourth ArrayList instance object and related reference variable. Then, write the Java code to copy all of the strings referenced that appear in only one of the two original ArrayList instance objects into the fourth ArrayList instance object. (f) Output the values now stored in the third and fourth ArrayList instance objects. Tip: To reduce the amount of code this could potentially take, carefully look over the methods available in class java.util.ArrayList. (Google “java 11 class ArrayList” and select the link to the Oracle docs about ArrayList.) (continued on the next page) CMPS 260 Spring 2019 Programming Assignment #6 (2019.03.03) 2 Additional Requirements (a)If there is user input, a reference variable and instance object of class java.util.Scanner must be used to read the input from the user. Prompts for any user input must be clear and relevant. (b)Output to the user must include appropriate labels. (c)Identifiers must be descriptive, i. e. must self document. The only exception granted is in the case of a “for variable”, that is a variable created as a simple counter as in the control variable in a “for” loop statement. (d)Indention of all code blocks (compound statements, anything in braces), including single statements following selection or while statements, is required. (e)The main “.java” file [the one with the method public static void main(String[] args)] of your Intellij projects must contain this minimal documentation as the first lines of the file (i. e. above the package statement): // Your Name // Your ID // CMPS 260 // Programming Assignment : # // Due Date : // Program Description: (a brief description of actions of your code) // Certificate of Authenticity: (Choose one of the two following forms:) // I certify that the code of this project, other than that that was generated by Intellij, is entirely // my own work. {or} // I certify that the code of this project, other than that that was generated by Intellij, is entirely // my own work, but I received some assistance from {name}. Follow this with a description of // the type of assistance. (For example, if you consulted a book, and your solution incorporates // ideas found in the book, give appropriate credit; that is, include a bibliographical reference.) // Note: You do not have to list the text, the author of the course text or the instructors examples. Submitting In Intellij, select File, Save All, then select File, Export to Zip File and click OK to save the Zip archive file. Finally, upload the zip archive file to Moodle. Helpful Hint: Keep a backup copy of your project folder on a Google Drive, a Drop Box Account, a USB memory device, etc., or even on Moodle! Finally, once you turn in your final version, create a copy before the due date and do not change this copy in any way. This final copy can be consulted if there is an upload disaster, but only if the “.java” files have not been changed in any way after the due date.