一站式論文代寫,英国、美国、澳洲留学生Essay代寫—FreePass代写

Java代寫|算法代寫 - CSCI 2110 Data Structures and Algorithms
時間:2020-10-22
Introduction This assignment will help you develop an understanding of ordered lists and basic recursion. Marking Scheme Exercise 1 /25 ? Working code, Outputs included, Efficient, Good basic comments included: 25/25 ? No comments or poor commenting: subtract up to 3 points ? Unnecessarily inefficient: subtract up to 4 points ? No outputs and/or not all test cases covered: subtract up to 2 points ? Code not working: subtract up to 14 points depending upon how many classes and methods are incorrect. ? Assignment submission and test case text files are not well labeled and organized: subtract up to 2 points. Exercise 2 /12 ? Working code, Outputs included, Efficient, Good basic comments included 12/12 ? No comments or poor commenting: subtract up to 2 points ? Unnecessarily inefficient: subtract up to 1 point ? No outputs and/or not all test cases covered: subtract up to 2 points ? Code not working: subtract up to 5 points depending upon how many classes and methods are incorrect. ? Assignment submission and test case text files are not well labeled and organized: subtract up to 2 points. Error checking: Unless otherwise specified, you may assume that the user enters the correct data types and the correct number of input entries, that is, you need not check for errors on input. Submission: All submissions are through Brightspace. Log on dal.ca/brightspace using your Dal NetId. Java Versions: Please ensure your code runs with Java 11. What to submit: Submit one ZIP file containing all source code (files with .java suffixes) and a text documents containing sample outputs. For each exercise you will minimally have to submit a demo Class with a main method to be tested and your test code, sample outputs. Your final submission should include the following files:OrderedList.java, list1.txt ,list2.txt, OrderedListDemo.java, merged.txt, RecursionExercises.java, Exercise2out.txt You MUST SUBMIT .java files that are readable by your TAs. If you submit files that are unreadable such as .class, you will lose points. Please additionally comment out package specifiers. Your code must compile. Failure to compile may result in a mark of 0. You may add extra helper methods as needed as long as you adhere to the functionality and specifications of this document. Exercise 0 (no marks): Ordered Lists Examine the java file OrderedList.java and its methods. Create a test file with a main method, and practice the following: ? inserting items to a new OrderedList object ? use the enumerate method to print the list ? using the binarySearch method for items in the list and items not in the list ? using the first() method, the next() method, and how they relate to the cursor variable You do not need to submit anything for this exercise. Exercise 1: Two-finger Walking Algorithm This exercise focuses on the two-finger walking algorithm for ordered lists. You will write a program called OrderedListDemo.java that can read a list of names from a file and construct an ordered list. You will be provided with the following starter files: OrderedList.java, list1.txt ,list2.txt. Examine these files and study the methods before proceeding. Create a demo class called OrderedListDemo.java ? In the main method, read in the values from list1.txt and list2.txt o Your program should accept input from a user (specifying the names of two input files) and read files formatted like the one described (see also: list1.txt and list2.txt). Your program should read two text files, each containing a list of names, and construct two ordered lists. o Store the lists in two separate OrderedList objects called names1 and names2 Input/Output If the input text file is: Shai Tom Jim Aaron Barbara Beth Fred Jack Jarred Jill Amar Ralph Jill Hillary It should create the following ordered list and display the contents of the list: [Aaron, Amar, Barbara, Beth, Fred, Hillary, Jack, Jarred, Jill, Jim, Ralph, Shai, Tom] Note: Although Jill is repeated in the input list, the ordered list does not have repeated items. . Finally, your program should demonstrate a method that returns a third list that is a merger of the two ordered lists. Use the two-finger walking algorithm discussed in class. Use the following method header: ? public static > OrderedList merge(OrderedList list1, OrderedList list2) If list1 is: Amar Boris Charlie Dan Fujian Inder Travis And list2 is: Alex Ben Betty Charlie Dan Pei Travis Zola Zulu Your method should create and return the new merged ordered list: Alex Amar Ben Betty Boris Charlie Dan Fujian Inder Pei Travis Zola Zulu Student Generated Test Cases: Test your program and print outputs from a sample run in the following format to a file called merged.txt: Enter the first filename to read from: list1.txt Enter the second filename to read from: list2.txt The Ordered Lists contain the following entries: List 1: [Amar, Boris, Charlie, Dan, Fujian, Inder, Travis] List 2: [Alex, Ben, Betty, Charlie, Dan, Pei, Travis, Zola, Zulu] A merged version of the two lists looks like this: [Alex, Amar, Ben, Betty, Boris, Charlie, Dan, Fujian, Inder, Pei, Travis, Zola, Zulu] Exercise 2: Recursion This exercise focuses on recursion. You will implement two static methods to solve two separate problems. All solutions must be recursive. Create a class called RecursionExercises.java. This class will contain the static methods and the main method to run your code. Create the following static methods: ? Write a recursive method call squares which accepts a single positive integer and calculates the sum of the squares of all the digits up to and including the integer. Use the following signature: o public static int squares(int n) o For example, squares(5) would return 55 ? Write a recursive method called reverseString which accepts a string and an integer. The method returns the passed in string in reverse order starting from a specified index. Use the following header: o public static String reverseString(String n, int i) o For example, reverseString(“Hello”,0) would return “olleH” o reverseString(“Hello”,1) would return “lleH” since we start from index 1. Input/Output Input: No user input for this exercise. Output: ? For the squares method call the method and print the following: o The sum of the squares up to [n] is: [answer] o Example: The sum of the squares up to 5 is: 55 ? For the reverseString method call the method and print the following: o Starting word is [word], reversed from index [i] is [answer] o Example: Starting word is Hello, reversed from index 2 is leH. Student Generated Test Cases: Demonstrate that your recursive methods work by calling them in the main method of the RecursionExercises.java class. ? Use print statements for the demo, no scanner is needed. ? Show 2 different examples for squares and 2 examples for reverseString with different index values. Test your program and print outputs from a sample run in the following format to a file called Exercise2out.txt.

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
专业essay代写|留学生论文,作业,网课,考试|代做功課服務-PROESSAY HKG 专业留学Essay|Assignment代写|毕业论文代写-rushmyessay,绝对靠谱负责 代写essay,代写assignment,「立减5%」网课代修-Australiaway 代写essay,代写assignment,代写PAPER,留学生论文代写网 毕业论文代写,代写paper,北美CS代写-编程代码,代写金融-第一代写网 作业代写:CS代写|代写论文|统计,数学,物理代写-天天论文网 提供高质量的essay代写,Paper代写,留学作业代写-天才代写 全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack