https://publicpagestutorbin.blob.core.windows.net/%24web/%24web/assets/Computer_sci1_f7cce0bb79.png

Do My Java Homework For Me

Get Java homework help from TutorBin if you are looking for excellent Java assignment assistance from experts.

https://publicpagestutorbin.blob.core.windows.net/%24web/%24web/assets/computer_sci_2_ea24e00fa1.png

Trusted by 1.1 M+ Happy Students

WhatsApp Support

Get Instant
Online Homework Help
via WhatsApp

Get instant homework help from top tutors—just a WhatsApp message away. 24/7 hw help support for all your academic needs!

A
S
M
R
★★★★★
2M+ students trust TutorBin
Your WhatsApp Number
phone
or
⚡ Instant reply
🔒 100% private
👨‍🏫 Top tutors
🌍 All subjects
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!
2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee2M+ Students Helped24/7 Live SupportExpert TutorsAll Subjects CoveredInstant Response100% ConfidentialTop Rated ServiceMoney-back Guarantee

Java Homework Help!

Java Homework Assistance From World-class Experts: Help With Java Homework

If you're studying computer science, you'll need to learn how to program in Java. Java has become one of the most extensively used programming languages in the industry over the last two decades. Though it is popular, the Java programming language may seem complicated due to its strict syntax, extensive memory management, and verbose code. However, with expert help, learning Java can be far easier than you have anticipated it to be.

If you are having difficulty with Java because it is an object-oriented programming language or for any of the reasons mentioned above, then it's time you opt for TutorBin. Our help with Java assignments enables students to grasp concepts clearly, generate code effectively, and apply their knowledge to solve problems efficiently. When you ask our experts, "Do my java homework for me," you get assistance to overcome your study challenges so that you can thrive in your studies, even in the most competitive academic environment.

Wondering if there is someone who can "do my Java assignment for me" or provide thorough assistance? TutorBin experts have got you covered. Exceptional assistance, high-quality assignments, instant responses, 24/7 access, and affordability make TutorBin Java programming assignment help a reliable service for students. The outstanding reviews from happy customers and higher ratings from students worldwide reflect why Java programming homework help is their ultimate preference.

Java Assignment Help | TutorBin

 

Java Topics
Multithreading and Concurrency JDBC (Java Database Connectivity)
File I/O and Serialization Java Networking (Socket Programming)
Java Streams and Lambda Expressions (Java 8+)Generics Java Memory Management & Garbage Collection
Domain and Range Java Development Tools (IDE usage, JDK, JVM, JRE)
Annotations and Reflection Remote method invocation
Java GUI (AWT & Swing) Logging

Why Do Students Need Expert Guidance for Java Hw Help?


Students frequently seek help with Java assignment for various Java programming homework. Here are some of the reasons why students seek Java homework help online.


  1. Java principles necessitate logical reasoning, which might be challenging for many students. Furthermore, the program's coding language makes it more difficult to understand than similar programming languages like Python or Ruby. Students frequently seek Java hw help or Java assignment help in these challenging conditions.
  2. Beginners take time to learn object-oriented programs such as Java. It interferes with their ability to work on other aspects of their academic education. As a result, they seek help with Java assignment to grasp concepts such as inheritance, polymorphism, and encapsulation.
  3. Even if you understand Java's logic, you may have redundancies or errors. Obtaining a grasp of strict syntax rules also prompts students to seek out subject experts who can help them find Java assignment solutions.
  4. Taking Java courses can be difficult for new learners. They often miss deadlines or complete projects inaccurately due to their limited expertise and skill set. As a result, they will receive lower grades on their homework.

Who Will Help Me To Do My Java Homework?


If you're wondering, "Who can help me do my Java homework for me?"—you have got TutorBin on your side. With a dedicated team of Java programmers and computer science professionals, these services connect you with specialists who understand Java inside out. Our team has a pool of subject specialists, including 800+ Ph.D and Masters degree holders. They not only have exceptional subject knowledge but also have prolonged tutoring experience, making them suitable to offer the best academic assistance.

How Does TutorBin Help with Java Assignment?

 

Whenever you opt for TutorBin, you collaborate with the subject experts who can provide you with the needed guidance whenever required. Whether you're stuck with loops, exception handling, or JavaFX, our experienced subject specialists are there for you. They provide timely, plagiarism-free, and well-explained solutions tailored to your academic level. Thorough guidance enhances conceptual clarity and improves coding skills in students, leading to better academic performance. Here's how they will help students to do their tasks efficiently.


  1. Drafting systematic, smooth programs with accurate output
  2. Theoretical and analytical accuracy
  3. Provide you with relevant Java help as per your guidelines.
  4. Edit programs and homework
  5. Create non-plagiarized programs
  6. Carry out in-depth research

How Do You Get Benefits From It?

 

Seeking assignment help online from TutorBin gives you access to the best tutors who will enhance your learning experience. Our experts provide accurate Java homework answers and ensure students clarify their doubts, understand their topics, and know how to apply concepts while solving real-life problems. Working with our tutors for Java hw help allows you to learn at your own pace without getting bogged down due to academic burden.


  1. Ask any questions about Java programming, whether they are specialized or general.
  2. To strengthen your comprehension of Java, go over the lessons you learned in class.
  3. Prepare for future examinations or quizzes.
  4. Inquire about particular components of a Java programming project.
  5. Learn the most effective methods for dealing with Java-related challenges.
  6. Get assistance matching your learning style.
  7. You'll have access to homework help Java 24 hours, seven days a week.
  8. Feel more assured about your Java programming skills.
  9. Improve your performance in class.
  10. Gain a better knowledge of real-world Java programs.

You can get help with Java homework at any time because our tutors are available around the clock. Whether it's early in the morning or late at night, our team of experts will offer you the Java assignment answers you need to complete Java tasks.

Advantages You Get When Opting for Java Assignment Help

When you ask us to "Do my java assignment," you get the following added features:


  1. Our experts offer 24/7 assistance for Java programming queries and assignments, including reliable Java assignment help.
  2. We value our students' time and deadlines! That's why we ensure on-time delivery of Java homework solutions.
  3. Our experts deliver perfect Java assignment solutions. The programs are flawless and help students fetch top grades on their homework. They confirm the high quality of the Java homework solution.
  4. At TutorBin, our experts ensure that every homework is free of errors. Be it in grammar, punctuation, sentence structure, concepts, theories, or program solutions.
  5. Our team of experts has years of experience in crafting Java assignments. When you ask us, "Can you do my Java assignment?" we aim to deliver the most professional assistance with Java coding.
  6. TutorBin has a zero-tolerance policy for plagiarism. Experts ensure every code is written from scratch. Our team doesn't reuse homework solutions, maintaining originality to adhere to academic integrity.
  7. We also understand the monetary constraints of the students. Hence, we offer the best services in the industry at the most pocket-friendly prices.

How Can You Get It Done Easily?

You can effortlessly hire an expert to complete your "Do my homework Java" or "Do my java homework for me" request through our simple and convenient approach. To get Java assignment help online on our website, which is a top Java assignment helper, follow the steps below:


  1. When you visit our Java assignment service page, you will see a prompt on that page.
  2. The first step to complete your "Can I pay someone to do my java homework?" request is to go to our signup page and register yourself using your email ID and other details.
  3. Please type your question or upload its picture along with question files, reference material, and guidelines to follow.
  4. Pick a deadline for your Java assignment and submit it.
  5. Depending on the complexity and deadline, you will get a price quotation for your Java hw help. Once you make the payment, it's time to choose the best writer.
  6. We will notify you via email/SMS after uploading the homework to your dashboard.


Develop Concept Clarity With TutorBin Java Homework Help Experts

Are you looking for a dependable Java assignment service provider who doesn't charge hefty amounts to complete your request? Are you thinking, "Can I pay for Java assignment?," Then you are at the right place. With TutorBin, you will receive satisfactory work that is 100 percent original when you pay for a Java assignment.

It will offer you the best study support that not only helps you increase your study inclination and build confidence but also boosts your academic performance. Our Java homework services make sure you learn uninterruptedly without hampering academic integrity. This is why students prefer TutorBin, and the platform has become a reliable resource for academic guidance.


FAQs for Java Assignment Help

Why Is “Do My Java Assignment” Searched So Often?

It's not easy to write a Java homework as it is difficult to understand. Working on the projects necessitates a thorough understanding of Java fundamentals. Students look for "Do My Java Assignment" for a variety of reasons, the most common of which are:

  • Time management issues
  • Difficulty in understanding Java concepts
  • The fear of receiving poor grades
  • Can you provide me with Java homework answers?

    Yes, we certainly can. With years of expertise providing java homework answers, we have a team of Ph.D. experts. Depending on your curriculum requirements, they can aid you with concepts and Java programming programs.

    Why is TutorBin the best java assignment helper?

    TutorBin is the best java assignment helper because of our commitment to customer satisfaction. We provide 100% original java assignment answers with no room for errors. We also offer multiple rewrites in case of dissatisfaction.

    How much time will TutorBin take to do my homework java?

    TutorBin's commitment to student deadlines is one of the reasons we are the best java hw help. Depending on the complexity of the homework, different types of homework take different amounts of time to complete. Our specialists, on the other hand, spare no effort to complete your work before the deadline.

    How much will it cost to seek TutorBin's java homework help online?

    Complexity will determine the cost of the homework. The cost of a project usually rises as it becomes more complex. However, at TutorBin, you can talk to the tutors about the final price quotes. You can also take advantage of our low prices, amazing add-ons, and discounts.

    How should I pay for java homework with TutorBin?

    You can visit TutorBin's website. On the homepage, you will find a sign-up option on the page. Once you sign-up with our website, you will be directed to a student dashboard. Once you reach our dashboard, you can place your java homework orders..

    Will I get a Original Work report when I seek help with java homework?

    Yes! One of our intriguing add-ons useful with our services is a original work report. If you request one, we will send you a Original work report.

    Recently Asked Java Questions

    Expert help when you need it
    • Q1:COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 Note. The assignment should be attempted through individual efforts, and any concerns related to academic integrity will be handled in accordance with the university's guidelines. Objectives: · Understand the major concepts of Object Oriented Systems, modelling the Class Diagrams, Sequence Diagrams, implementation in Java and Unit Testing using Junit in Java. Question 1 (30 points) Java Programing: Study the code well and then implement the required classes below. You can complete your implementation within this code as directed. The requirements are shown below the code (a & b). import java.util.Date; public class InternetCharge implements Cloneable { double bandwith; boolean isLimited; double monthlyRate; Date startDate; public InternetCharge(double bandwith, boolean limited, double monthlyRate, Date startDate) { this.bandwith = bandwith; this.isLimited = limited; this.monthlyRate = monthlyRate; Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 this.startDate = startDate; } public void setMonthlyRate(int rate) throws Exception { if (rate < 0) throw new Exception("Rate cannot be negative"); if (isLimited) { this.monthlyRate = rate * 1; } else if (!isLimited) { this.monthlyRate = rate * 1.5; } } public double getMonthlyCharge() { return monthlyRate * bandwith * 0.5; } @Override public Object clone() { // Write your code here } } Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 a) The method clone is provided in the Object class. Override the method clone to perform deep copy for InternetCharge. b) Write two test methods for InternetCharge. The first test method is to test whether the getMonthlyCharge operation is correct. The second test method is to test whether an exception is thrown by the setMonthlyRate method. Questions 2 (30 points) Modelling & coding: Class Diagram a) Draw a class diagram that models the following: Animals can eat and move. Birds are animals that can fly. Chicken, Eagle, Cow, Rabbit, and Tiger are animals. Chicken and Eagle are birds. Chicken and Cow are edible. You can not create an object of Animal or Bird. Peas and Carrot are Plants. Plants are edible. Tigers eat any Animal, Chicken eat Peas, Cows eat any plant, Rabbits eat Carrot, and Eagle eat any Animal. Make sure to include methods that model behaviours in each class. If something can be modelled using association, the preference should be given to using association. b) Write a Java program that include classes and interfaces for the above scenario. Each concrete class should override the toString() method to print the name of the animal or plant. Edible animals should have a method that returns string called howToEat(). For edible animals, howToEat() should return "roast it" and for plants, this method should return "eat as you wish". In addition, you have to write a main method in a separate class. In the main method, you have create an object for each animal or plant, and call toString on it. For edibles, you have to print the string returned from howToEat(). Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 Questions 3 (10 points) Modelling: Sequence Diagram A passenger wants to book a flight. First, she checks if the flight has an available seat, if yes, a booking object is created and the passenger is added to the booking object. If the flight doesn't have available seats, it will create a waitlist object and will add the passenger to the object. Draw a sequence diagram that illustrates this scenario. Question 4 (30 points) Software Unit testing using Junit Utilize the provided "Book" class, to generate test cases for conducting unit testing using JUnit. The "Book" class is provided below and some of the JUnit code has been supplied under the "Book" Class code along with clarification for the missing code necessary for executing the test cases. The following test cases are needed: Test Case - Title and Author: · Write a test case to ensure that the title and author attributes of a Book object are correctly set and retrieved. Test Case - Pages: · Write a test case to verify that the pages attribute of a Book object is correctly set and retrieved. Test Case - Published Year: · Implement a test case to check if the publishedYear attribute of a Book object is correctly set and retrieved. Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 Test Case - isClassic Method: · Write a test case to confirm that the isClassic method of the Book class correctly identifies classic books published before the year 2000. Edge Case Test: · Create a test case to handle an edge case, such as a book with zero pages or a book published in the year 2000. package junitTest; public class Book { private String title; private String author; private int pages; private int publishedYear; public Book(String title, String author, int pages, int publishedYear) { this.title = title; this.author = author; this.pages = pages; this.publishedYear = publishedYear; } public String getTitle() { return title; } public String getAuthor() { return author; } Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 public int getPages() { return pages; } public int getPublishedYear() { return publishedYear; } public boolean isClassic() { return publishedYear < 2000; } } The Junit test code: package junitTest; import static org.junit.jupiter.api.Assertions .*; import org.junit.jupiter.api.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class BookTest { @Test Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 public void testTitleAndAuthor() { // Write code here to create a test case to ensure that the title and author //attributes of a 'Book' object are correctly set and retrieved. //Example of parameters that can be used: ("Java Programming", "John //Doe", 300, 2010) } @Test public void testPages() { // Write code here to create a test case to ensure that that the pages //attribute of a 'Book' object is correctly set and retrieved. //Example of parameters that can be used: ("Data Structures", //"Jane //Smith", 500, 1998) } @Test public void testPublishedYear() { // Write code here to create a test case to check if the publishedYear //attribute of a 'Book' object is correctly set and retrieved. //Examples of parameters that can be used: ("Algorithms", "Alan Turing", //400, 1940); } @Test public void testIsClassic() { // Write code here to create a test case to confirm that the isClassic method //of the Book class correctly identifies classic books published before the //year 2000. //Examples of parameters that can be sued: ("Classic Novel", "Classic //Author", 200, 1950) Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 @Test } public void testEdgeCase() { // Write code here to create a test case to handle an edge case, such as a //book with zero pages or a book published in the year 2000. //Example of parameters that can be used: ("Edge Case", "Edge Author", 0, //2000) } } Fall 2023 COIS 2240H - Software Design & Modelling Assignment 3 - Class Diagram, Sequence Diagrams, Java Code and Unit Testing Total points: 100 Deliverables: (Zipped submissions will NOT be graded). Question 1. · The Java program source code (You must submit the program regardless whether it complete, correct of incorrect). · Screenshot of the output Question 2. · Screenshot of the Class Diagram · The java programing source code for the Class Diagram · Screenshot of the output of the Java Code Question 3. · Screenshot of the Sequence Diagram Question 4. · The completed Java source Code . Screenshot of the Unit Testing output. The output should show the test cases using Junit passed the test. See screenshot below: Runs: 5/5 @ Errors 0 Il Failures 0 v h- BookTest (Runner: JUnit 5] (0.022 s) testedgeCase0 (0.12 s) del testTicieAndAuthorO) (0,001 ) nil testPublishedYear0 (0.001 s) testisClassic() (0.001 s) Fall 2023/nCOIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 Note. The assignment should be attempted through individual efforts, and any concerns related to academic integrity will be handled in accordance with the university's guidelines. Objectives: · Understand the major concepts of Object Oriented Systems, and modelling the State Diagrams, Activity Diagrams and implementation in Java programming language Question 1 (36 points) Java Programing: In the code provided below, you will find the class GeometricObject and Triangle. Study the code well and then implement the required classes below. You can complete your implementation within this code as directed. The requirements are shown below the code (1-5). public abstract class GeometricObject { private String color = "white"; private boolean filled; private java.util.Date dateCreated; /* Construct a default geometric object */ protected GeometricObject() { dateCreated = new java.util.Date(); } /* Construct a geometric object with color and filled value */ protected GeometricObject(String color, boolean filled) { dateCreated = new java.util.Date(); this.color = color; this.filled = filled; Fall 2023 COIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 / ** Return color */ } public String getColor() { return color; } / ** Set a new color */ public void setColor(String color) { this.color = color; } / ** Return filled. Since filled is boolean, * the get method is named isFilled */ public boolean isFilled() { return filled; } / ** Set a new filled */ public void setFilled(boolean filled) { this.filled = filled; } / ** Get dateCreated */ public java.util.Date getDateCreated() { return dateCreated; } @Override public String toString() { return "created on " + dateCreated + "\ncolor: " + color + " and filled: " + filled; } / ** Abstract method getArea */ public abstract double getArea(); / ** Abstract method getPerimeter */ Fall 2023 COIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 public abstract double getPerimeter(); } class Triangle extends GeometricObject { private double side1 = 1.0, side2 = 1.0, side3 = 1.0; / ** Constructor */ public Triangle() { } / ** Constructor */ public Triangle(double side1, double side2, double side3) { this.side1 = side1; this.side2 = side2; this.side3 = side3; } /* Override method findArea in GeometricObject */ public double getArea() { double s = (side1 + side2 + side3) / 2; return Math.sqrt(s * (s - side1) * (s - side2) * (s - side3)); } / ** Override method findPerimeter in GeometricObject */ public double getPerimeter() { return side1 + side2 + side3; } / ** Override the toString method */ public String toString() { // Implement it to return the three sides return "Triangle: side1 = " + side1 + " side2 =" + side2 + " side3 = " + side3; } } Fall 2023 COIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 class Test { public static void main(String[] args) { GeometricObject gObjectArray [] = new GeometricObject [4]; //Complete your code here } private static void printAreaAndPerimeter(GeometricObject gObject) { //Complete your code here } } 1. Implement the classes Circle, EquilateralTriangle, Rectangle, and Square. 2. Implement the method printAreaAndPerimeter in the Test class that prints the area and the perimeter of the passed GeometricObject. 3. In the Test class, create an array of GeometricObject of size 5. The first element should be assigned to a Circle object: new Circle(4,4,4). The second element should be assigned to an EquilateralTriangle object: new EquilateralTriangle(3). The third element should be assigned to a Triangle object: new Triangle(3,3,3). The fourth element should be assigned to a Rectangle object: new Rectangle(2,2). The fifth element should be assigned to a Square object: new Square(10). 4. Pass each element in the array to printAreaAndPerimeter. Fall 2023 COIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 5. Compile, Run, and take a screenshot of the output and submit to Blackboard (you must submit the program regardless whether it complete or incomplete, correct or incorrect) Questions 2 (32 points) Modelling: State Diagram Draw a state diagram that models a BankAccount object: a bank account can either have enough cash or be out of cash. If the account is out of cash, it will allow for money to deposited. If the account has enough cash, it will allow for money to be deposited and withdrawn. The account is out of cash if the amount in the account is below a predetermined minimum. Questions 3 (32 points) Modelling: Activity Diagram In an online purchasing system, the buyer requests to buy an item. In parallel, the system looks up whether the item exists in the store and verifies if the buyer has an account with the system. If the buyer does not have an account, the system will ask for registration info from the buyer to open an account. If the buyer does not provide registration info, the system exits. If the item does not exist in the store, the system exits. If the item exists, the system will check if the item price is less than or equal to buyer's account balance. If the buyer has enough money in the account to purchase the item, the system completes the purchase order successfully. If the buyer does not have enough money, the system exits. Fall 2023 COIS 2240H - Software Design & Modelling Assignment 2- Sate, Activity Diagrams & Java programming Total points: 100 Deliverables: 1. "pdf" file containing Screenshots of the output for your Java program (Q1). 2. The Java program source code (Q1) (You must submit the program regardless whether it complete, correct of incorrect). 3. Screenshots of the State Diagrams and Activity Diagrams ( Q2 & Q3). Note: Do not Zip your submissions. Zipped submissions will NOT be graded. Note. 10% will be deducted for every business day for late submission. Fall 2023See Answer
    • Q2:1 Final Project: Super Snake Description: In this assignment, you will be tasked with refactoring and redesigning the Snake game in Chapter 17 to improve its structure, readability, and maintainability. The goal is to separate different functions into their own classes and apply design patterns where appropriate. You will also need to enhance the gameplay by introducing new features and challenges. You can work in groups of 4 people. Use everything you’ve learned so far to upgrade Snake to the next level! Tasks: **Task 1: Code Refactoring** 200 Points - Review the existing Snake game codebase provided to you. - Identify areas where code can be refactored to improve readability and reduce redundancy. - Separate different functions into their own classes to increase modularity and maintainability. - Refactor code with Refactoring techniques. - Utilize the concepts from our lectures and previous assignments **Task 2: Design Pattern Implementation** (Must choose 2): 100 Points - Identify opportunities to apply design patterns within the codebase. Some ideas: - Implement the Strategy Pattern to separate audio-related functionality into the `Audio` and `AudioContext` classes. - Implement the Builder Pattern to create different `Apple` types with different properties and effects on the player. - Use the Decorator Pattern for Snake to apply power ups, harmful effects, and cool features. ** These are recommended design patterns; you may use any which are applicable. ** Refer to Design patterns lecture. Mandatory: Change up the design completely: UI elements Character models Sound elements / music Background **Task 3: Gameplay Enhancements** (Must choose 4) 200 Points Introduce randomness to assign scores to good apples and bad apples. Power-Ups: Introduce power-up items that the snake can collect. These power-ups can have various effects, such as increasing the snake's speed, making it invulnerable for a short time, or allowing it to eat bad apples without penalties. Obstacles: Add obstacles on the game board that the snake needs to avoid. Colliding with an obstacle could result in a penalty, such as a decrease in the snake's length or speed. High Scores and Leaderboards: Implement a high score system that keeps track of the best scores achieved by players. Display the current game score as well while the game is running. Sound Effects and Music: Enhance the audio experience with background music and different sound effects for various in-game actions. Progressive Difficulty: Make the game progressively harder as the player advances, with faster apples spawning, more obstacles, or additional challenges. This keeps the game interesting for longer periods. Game Over Screen: After a game over, show the player's final score and provide options to restart the game or return to the start screen. If you have other ideas, run them by me first, but be creative. These features are just suggestions. Your game needs to have a “wow” factor. This could include lots of extra features, how well designed (and fun) the game is, or just good old-‐fashioned polish—anything that will make your game really stand out! **Submission Details** If you encounter difficulties with any part of the assignment, document your efforts and any issues faced. The goal is not just to implement design patterns but also to learn from the challenges you encounter during the refactoring process. I do expect tangible improvements to the Snake Game that are more than just a few new classes. Try your best to improve this game according to the assignment’s requirements. Final Report and Submission: 100 points Thorough report of the changes you made, with proper formatting, images, a tutorial on the UI of the game and how to play the game. Git logs as wellSee Answer
    • Q3:1 Final Project: Super Snake Description: In this assignment, you will be tasked with refactoring and redesigning the Snake game in Chapter 17 to improve its structure, readability, and maintainability. The goal is to separate different functions into their own classes and apply design patterns where appropriate. You will also need to enhance the gameplay by introducing new features and challenges. You can work in groups of 4 people. Use everything you’ve learned so far to upgrade Snake to the next level! Tasks: **Task 1: Code Refactoring** 200 Points - Review the existing Snake game codebase provided to you. - Identify areas where code can be refactored to improve readability and reduce redundancy. - Separate different functions into their own classes to increase modularity and maintainability. - Refactor code with Refactoring techniques. - Utilize the concepts from our lectures and previous assignments **Task 2: Design Pattern Implementation** (Must choose 2): 100 Points - Identify opportunities to apply design patterns within the codebase. Some ideas: - Implement the Strategy Pattern to separate audio-related functionality into the `Audio` and `AudioContext` classes. - Implement the Builder Pattern to create different `Apple` types with different properties and effects on the player. - Use the Decorator Pattern for Snake to apply power ups, harmful effects, and cool features. ** These are recommended design patterns; you may use any which are applicable. ** Refer to Design patterns lecture. Mandatory: Change up the design completely: UI elements Character models Sound elements / music Background **Task 3: Gameplay Enhancements** (Must choose 4) 200 Points Introduce randomness to assign scores to good apples and bad apples. Power-Ups: Introduce power-up items that the snake can collect. These power-ups can have various effects, such as increasing the snake's speed, making it invulnerable for a short time, or allowing it to eat bad apples without penalties. Obstacles: Add obstacles on the game board that the snake needs to avoid. Colliding with an obstacle could result in a penalty, such as a decrease in the snake's length or speed. High Scores and Leaderboards: Implement a high score system that keeps track of the best scores achieved by players. Display the current game score as well while the game is running. Sound Effects and Music: Enhance the audio experience with background music and different sound effects for various in-game actions. Progressive Difficulty: Make the game progressively harder as the player advances, with faster apples spawning, more obstacles, or additional challenges. This keeps the game interesting for longer periods. Game Over Screen: After a game over, show the player's final score and provide options to restart the game or return to the start screen. If you have other ideas, run them by me first, but be creative. These features are just suggestions. Your game needs to have a “wow” factor. This could include lots of extra features, how well designed (and fun) the game is, or just good old-‐fashioned polish—anything that will make your game really stand out! **Submission Details** If you encounter difficulties with any part of the assignment, document your efforts and any issues faced. The goal is not just to implement design patterns but also to learn from the challenges you encounter during the refactoring process. I do expect tangible improvements to the Snake Game that are more than just a few new classes. Try your best to improve this game according to the assignment’s requirements. Final Report and Submission: 100 points Thorough report of the changes you made, with proper formatting, images, a tutorial on the UI of the game and how to play the game. Git logs as wellSee Answer
    • Q4:CSECUTA The Testing Project CSE 4321 Motivation · Provides an opportunity to practice the basic concepts, principles, and techniques covered in this course . Specifically, you will apply control flow testing to a program of moderate size - Printtokens.java: a Java class that implements a string tokenizer (available in Canvas). - about 500 lines of code with seeded faults CSECUTA - Both members will receive the same grading. Input and Output · Input - Location of a file (i.e., input to the main() method) that contains the tokens to be classified - If a location is not given, the user is expected to type the tokens to be classified on the console. · Output - Type of each token, one per line CSE 4321, Jeff Lei, UTA CSECUTA Type of Tokens · Keyword: and, or, if, xor, lambda, => . Special Symbol: "(", ")", "[", "]", "" ,"", '," (Iparen, rparen, lsquare, rsquare, quote, bquote, comma) · Identifier: begins with a letter and contains only letters and digits, e.g., a, aa, a1, a2. · Number Constant: e.g., 123, 1, 321 · String Constant: e.g., "asd", "123" · Character Constant: e.g., #a, #b, #c, #d . Comment: Anything starts with ";" CSE 4321, Jeff Lei, UTA CSECUTA • Error: Everything else Example test.txt 1 and` and 2 j Input: 3 112A Arguments: C Main (x)= Arguments JRE Deper Program arguments: "./test.txt" CSE 4321, Jeff Lei, UTA CSECUTA Problems @ Javadoc Declaration Console X <terminated> Printtokens2 [Java Application] /Library/Java/JavaVirtualMachines keyword , "and". bquote. keyword, "and". identifier,"j". Output: error, "112A". Major Steps Create the Control Flow Graph (CFG) for each method • - The code in the catch clauses can be skipped, i.e., these clauses do not need to be represented in the CFG . Unit Testing: For each method other than the main method, select a set of test paths to achieve edge coverage, i.e., cover all the edges in the CFG of the method CSE 4321, Jeff Lei, UTA CSECUTA • Program Testing: For the main method, select a set of test paths to achieve edge coverage for the entire program, i.e., cover all the edges in all the CFGs. • Generate test cases, including test data and expected output, for each test path - If a test path you selected in the previous step is infeasible, a new test path needs to be selected . Use JUnit to implement and execute the generated test cases. · Provide edge coverage reports for tests executed. - One report for the unit tests of individual methods, and one report for the program-level tests of the main method Deliverables . Due date (FIRM): July 3 (midnight, last day of class) CSE 4321, Jeff Lei, UTA CSECUTA . 20%: CFGs along with the corresponding source code, and the basic block table that identifies each basic block . 30%: Test cases, including each test path, the corresponding test data to execute the test path, and the expected output . 25%: JUnit source code · 5%: Code coverage reports . 10%: Faults detected and corrections · 5%: Summary and discussion. . 5%: A ReadMe file that explains how to execute your JUnit code CSE 4321, Jeff Lei, UTA CSECUTA Must-Have Files . Your project should be submitted in GitHub Classroom · Must contain these but not limited to these files. - CFG.pdf - Test Cases.pdf - Source Code - Code Coverage Reports.zip - Faults and Corrections.pdf - Summary and Discussion.pdf - ReadMe.txt · Typed reports are strongly recommended; if you choose to handwrite and scan the reports, it is your responsibility to ensure legibility. CSE 4321, Jeff Lei, UTA CSECUTA Evaluation · Faults detected and code coverage are not the main focus of our evaluation. . If you follow the approach correctly, you could expect to detect at least 10 bugs. . Focus on the "approach", instead of the "faults" Recommendations . IDE: Eclipse; Code Coverage: JaCoCo/EclEmma CSE 4321, Jeff Lei, UTA CSECUTA - Refer to the video titled "Get started with the project" in Canvas - Other tools could be used, but you may be asked to give a demo for the TA . When you find a fault, fix it before you continue. This could help to discover more faults. . If fixing a fault alters the control flow, you are not required to construct a new CFG. . Do not try to use CFG generation tools for Java programs; otherwise, you will receive no points on the project. - Many tools generate CFGs based on byte code, not source code. The output could be incorrect w.r.t the project specification. CSE 4321, Jeff Lei, UTASee Answer
    • Q5: Background Truth table for AND A TRUE FALSE TRUE FALSE Truth table for OR A TRUE FALSE TRUE FALSE Truth table for XOR A TRUE FALSE TRUE FALSE B TRUE TRUE FALSE FALSE B TRUE TRUE FALSE FALSE B TRUE TRUE FALSE FALSE EXPRESSION A AND B A AND B A AND B A AND B EXPRESSION A OR B A OR B A OR B A OR B EXPRESSION A XOR B A XOR B A XOR B A XOR B RESULT TRUE FALSE FALSE FALSE RESULT TRUE TRUE TRUE FALSE RESULT FALSE TRUE TRUE FALSE Truth table for NAND A TRUE FALSE TRUE FALSE Truth table for NOT A TRUE FALSE B TRUE TRUE FALSE FALSE EXPRESSION A NAND B A NAND B A NAND B A NAND B EXPRESSION NOT A NOT A RESULT FALSE TRUE TRUE TRUE Primitives supported: 'true' and 'false' Unary operations supported: 'not' Binary operations supported: 'and', 'or', 'xor', 'nand' RESULT FALSE TRUE Problem Description Your professor has decided to start a new business as a baker. However, instead of just putting normal prices on his cakes, each cake is assigned an array of symbols that represent different operations. Sample input: [ 'true', 'or', 'true', 'and', 'false' ] The way pricing works is that if the cake's entire expression evaluates to "true" then the cake is free. In the other case, if the entire expression evaluates to "false" it cannot be purchased. You are not allowed to change any of the symbols, but you may add a set of parentheses for a fixed price (in dollars) equal to the number of units apart the parentheses are from each other. Thus, if we place a set of parentheses around ('true') that would be $1. If we were to place a set of parentheses around ('true', 'and', 'false') that would be $3. Looking at our example "true or true and false" there are only two possible ways to evaluate this expression: true Choice 1 true or true and false or true and False True Choice 2 true or (true and false) or True and False Note: You only need to place parentheses where needed as the expression will be otherwise evaluated from left to right automatically. Thus, the first choice evaluates to false: [ 'true', 'or', 'true', 'and', 'false' ] [ 'true', 'and', 'false' ] ['false'] But if we place a set of parentheses as in choice 2, it will evaluate to true: [ 'true', 'or', ('true', 'and', 'false' ) ] [ 'true', 'or', ( 'false' ) ] ['true'] Write an algorithm using dynamic programming that when given the cake's information as input you can determine the minimum cost to buy that cake. You can assume the expression provided will be legal and syntactically correct. Suggested approach: Get your program working with just AND and OR to start. Once it is working correctly, then add the 'XOR' and 'NAND' operators. Once you have that working, now you can attempt adding the 'NOT' operator. Action Items / Requirements Select your favorite programming language. The only restriction is that the instructor needs to be able to compile and execute your code. For full credit your program must: O Compile without error and run correctly O Use dynamic programming as part of the main algorithm O Accept as input from the user a series of symbols that define the cake's price. o Output the correct minimum cost to purchase that cake. The algorithm must be as efficient as possible [O( ? ) ]. Approaches that are worse receive less credit. Only the efficiency of the "price algorithm" needs to be analyzed and optimal. Have sufficient unit tests for your algorithm. "Manual testing" is not accepted ■ You may use some unit testing framework in your language or write a simple framework that executes your code with automated inputs and expected results. ● ● ● O Prepare a report (PDF or MS Word) with the following O Instructions to compile and execute your program including any necessary requirements/packages/etc. O Describe how you came up with the algorithm and explain/justify how it works. This should be sufficient so that another person should generally understand how it works. o Analyze your implementation's efficiency (The algorithm that computes the cost). Either perform a line-by-line analysis or a sufficiently detailed analysis. This should result in an overall worst-case asymptotic order notation. Example runtime: What is the description of the cake? > true Calculating... The price for that cake is $0 Do you want to examine another cake? > Yes What is the description of the cake? > false Calculating... That cake is impossible to buy Do you want to examine another cake? > Yes What is the description of the cake? > true or true and false Calculating... The price for that cake is $3 Do you want to examine another cake? > Yes What is the description of the cake? > true and true xor not false and false Calculating... The price for that cake is $4 Do you want to examine another cake? > Yes What is the description of the cake? > true and not true xor false and false xor false Calculating... The price for that cake is $5 Submission Instructions 1. Compress your source code files, tests, additional files necessary to run your program, the report, etc. in a single zip file.See Answer
    • Q6: CMSC 215 Intermediate Programming Programming Project 2 The second programming project involves writing a program that produces a list of students who are eligible for membership in an honor society. This program consists of four classes. The first class is the student class. It has three instance variables which include the student name, credit hours earned and quality points. At a minimum, it should have following methods: • • A constructor that allows the student's name, credit hours and quality points to be initialized. A method named gpa that returns the student's grade point average, which is computed as the quotient of the quality points and credit hours A method eligibleForHonor Society that returns whether a student's gpa exceeds the threshold for honor society membership, which applies to all students A toString method that returns a string containing the student name and grade point average A class (static) method setGpaThreshold that sets the minimum gpa threshold for honor society membership The Student class has two subclasses. The first is Undergraduate. It has an additional instance variable that specifies the student's year: either a freshman, sophomore, junior or senior. At a minimum, it should have following methods: • • A constructor that allows the student's name, credit hours, quality points and year to be initialized An overridden method eligibleForHonor Society that applies the requirement that the student be either a junior or senior in addition to the requirement that applies to all students to be eligible for honor society membership An overridden toString method that returns a string containing the student name, grade point average, and year The second subclass is Graduate. It has an additional instance variable that reflects whether the student is pursuing a master's degree or doctorate At a minimum, it should have following methods: • • A constructor that allows the student's name, credit hours, quality points and degree sought to be initialized An overridden method eligibleForHonor Society that applies the requirement that the student be seeking a master's degree in addition to the requirement that applies to all students to be eligible for honor society membership An overridden toString method that returns a string containing the student name, grade point average, and degree sought Finally there should be a fourth class Project2 that contains the main method. It should read in student information from a text file named students.txt. If the file does not exist, an error message should be displayed and the program should terminate. Each line of the text file will represent the information for one student. An example of how the text file will look is shown below: Brown, William 72 230 Junior Johnson, Mary 21 77 Masters Jones, Sally 32 95 Sophomore For undergraduate students, the final value is the student's year. For graduate students, the final value is the degree the student is seeking. As the students are read in, Student objects of the appropriate type should be created and they should be stored in an array list of type student. As the students are read in, the total of all grade point averages should be accumulated so that an average gpa can be computed. You may assume that the file that the data in the file will be formatted correctly. Once all the student data is read in, the threshold for honor society membership should then be set to the midpoint of the average gpa and the highest possible gpa of 4.0 by calling the setGpaThreshold method. The threshold should also be displayed on the console. Then a report should be displayed on the console that lists all students who are eligible for membership . Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough test data to completely test the program. You are to submit two files. 1. The first is a .zip file that contains all the source code for the project. The .zip file should contain only source code and nothing else, which means only the . java files. If you elect to use a package, the .java files should be in a folder whose name is the package name. Every outer class should be in a separate .java file with the same name as the class name. Each file should include a comment block at the top containing your the project name, the date, and a short description of the class contained in that name, file. 2. The second is a Word document (PDF or RTF is also acceptable) that contains the documentation for the project, which should include the following: a. A UML class diagram that includes all classes you wrote. Do not include predefined classes b. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing c. A short paragraph on lessons learned from the projectSee Answer
    • Q7:Task 1: Write a Java program to declare integer, long and float data types. Following the methods of type casting, demonstrate implicit and explicit type casting amongst the declared data types.See Answer
    • Q8: An Assembler translates a program in symbolic assembly code into native machine code. Create a mini-Assembler for a 32-bit MIPS processor. Your program should accept input lines from the user until HALT is read. With each line, translate the line into MIPS machine code. Print the total space needed for the completed program. To make the parsing easier, there is one instruction per line, and each token is separated by spaces (no commas, parentheses or labels). You should convert all input to upper case. You do not need to check for illegal codes or registers. If a <shift_amount>, <immediate>, or <branch_address> is too large for the field, mask off the bits you need. For form for all assembly lines read will be: • • <code> <rd> <rs> <rt> (for codes add, and) • <code> <rd> <rt> <shift_amount> (for codes srl, sll) • • <code> <rt> <rs> <immediate> (for codes addi, andi) • beq <rs> <rt> <branch_address> • Iw <rt> immediate <rs> • sw <rt> immediate <rs> Your Assembler should accept the following subset of the complete ISA: • • . Functions: add, addi, and, andi, beq, lw, sw, srl, sll Registers: $zero, $v0-1, $a0-3, $t0-9, $s0-7 Immediates and shift amounts should be read in decimal • Branch addresses should be read as a decimal offset from PC+4 (positive or negative) Notes: • Do not create these classes in a package. • Turn in only your Java source files. • • • Your assembler can read and translate one line at a time. It does not need to read in the whole file first. In the example below, I cut and pasted nine lines into the running program. Printing a 32-bit binary number can be done in Java with the following: о || System.out.println("***: + String.format("%32s", Integer.toBinaryString(word)).replace("", "0")); • You may find it useful to define methods similar to the following: о int makeR(byte opcode, byte rs, byte rt, byte rd, byte shamt, byte funct) Constructs a 32-bit integer from the component parts for an R-type instruction. int makel(byte opcode, byte rs, byte rt, short immed) Constructs a 32-bit integer from the component parts for an I-type instruction. byte regToByte(String r) Converts a string representation of a register to its numeric equivalent. For example, if you pass in "$s5", it will return 21. Why 21? Check you green sheet, bottom righthand corner). Required Main Class: Assembler Required Input: Lines of assembler code, separated with newlines, followed by a line with "HALT”. Required Output: Your output should look something like the following example. It should include your name. Assembler *** Enter your name Begin entering Assembler: ADD $v0 $v1 $zero AND $a0 $a1 $a2 ADDI $a3 $t4 -321 ANDI $10 $15 123 BEQ $s0 $t1 +517 LW $s1-12 $t2 SW $s2 20 $t3 SRL $a2 $a3 3 SLL $a3 $a2 31 HALT ***: 00000000011000000001000000100000 ***: 00000000101001100010000000100100 ***: 00100001100001111111111010111111 ***: 00110001101010000000000001111011 ***: 00010010000010010000001000000101 ***: 10001101010100011111111111110100 *** 10101101011100100000000000010100 ***: 00000000000001110011000011000010 ***: 00000000000001100011111111000000 *** Assembly complete. Program required 9 words of memory.See Answer
    • Q9: Project 1 Project School Database Use the UML provided below to develop the necessary Java classes. Follow the OBJECTIVES & GRADING RUBRIC to develop your project and meet the requirements Use the Initial Text File and Sample Output provided at the end of this file to complete the I/O portion SUBMISSION INSTRUCTIONS: 1. Submit your source code to zybook for grading using the test cases that have been provided for the project. (65 points) 2. Record a 5-10 minute video of the project running through the steps to demonstrate the functionality as you explain it. (35 points) Explain the code in depth and cover all points from the rubric in order. 3. Upload your video to YouTube and provide the link as a comment in your code at the top of the Driver_SchoolDB java file. (The visibility of your video must NOT be private. It CAN be unlisted) NOTE: Video explanation and code must both be submitted by the deadline to earn credit, even if the program is not fully functional. Any code submission without a video is NOT eligible for grading and will be marked with a score of zero. Course - is Graduate Course: boolean - courseNum: int - courseDept: String - numCredits: int + Course (boolean isGraduateCourse, int courseNum, String courseDept, int numCredits) + is Graduate Course(): boolean + getCourseNum(): int + getCourseDept(): String + getNumCredits(): int + getCourseName: String + equals(Object obj): boolean be considered equal + toString(): String //return String of “U” or “G” + courseDept + courseNum //all attributes must match for 2 Course objects to //"Course: %3s-%3d | Number of Credits: %02d | Graduate/Undergraduate”, courseDept, courseNum, numCredits, isGraduate Course + compareTo(Course c): int //use the Comparable interface specification. Sort by| courseNum Person name: String - birth Year: int + Person() // name = 6699 birth Year = 0 ' + Person(String name, int birth Year) + getName(): String + getBirth Year():int + setName(String name): void + setBirth Year(int year): void + equals(Object obj): boolean objects to be considered equal toString(): String //all attributes must match for 2 Person //"Person: Name: %30s | Birth Year: %4d", name, birth Year compareTo(Person p): int specification. Sort by birth Year. //use the Comparable interface Employee extends Person - deptName: String - numEmployees: static int - employeeID: int //generated + Employee() // deptName 6699 = ' employeeID computed // employeeID computed + Employee(String deptName) // employeeID computed + Employee(String name, int birth Year, String deptName) + getDeptName(): String + static getNumEmployees(): int + getEmployeelD(): int + setDeptName(String deptName): void + equals(Object obj): boolean //all attributes inherited+local must match for 2 Employee objects to be considered equal + toString(): String Employee Number: %3d", deptName, employeeID + compareTo(Person p): int employeeID //"<content of Person> Employee: Department: %20s | //use the Comparable interface specification. Sort by Faculty extends Employee courses Taught: Course[] number of courses a faculty has // you can assume that the maximum // taught cannot exceed 100 boolean numCourses Taught: int //controlled variable - isTenured: + Faculty() // courses Taught = [], numCourses Taught = 0, is Tenured = false + // courses Taught = [], numCourses Taught = 0, Faculty(boolean is Tenured) this.isTenured = is Tenured + Faculty(String deptName, boolean is Tenured) + Faculty(String name, int birth Year, String deptName, boolean is Tenured) + is Tenured():boolean + getNumCourses Taught(): int + setls Tenured (boolean is Tenured): void + addCourse Taught (Course course): void array + addCourses Taught(Course [] courses): void array + getCourse Taught(int index): Course "null" if invalid + getCourse TaughtAsString(int index): String invalid + getAllCourses TaughtAsString(): String method + equals(Object obj): boolean objects to be considered equal + toString(): String Taught: %3d | //appends course to the end of the existing //appends courses to the end of the existing // note: index must be verified. Return 6699 // note: index must be verified. Return “” if // returns "courseDept-courseNum" // comma separated list of all courses taught // uses getCourse TaughtAsString(int index) as a helper //all attributes inherited+local must match for 2 Faculty //"<content of Employee> Faculty: %11s | Number of Courses Courses Taught: %S", Is Tenured/Not Tenured numCourses Taught, getAllCourses TaughtAsString() + compareTo(Person p): int // use the Comparable interface specification, sort by // numCourses Taught GeneralStaff: extends Employee - duty: String + GeneralStaff() + GeneralStaff(String duty) // duty 6699 = + GeneralStaff(String deptName, String duty) + GeneralStaff(String name, int birth Year, String deptName, String duty) + getDuty(): String + equals(Object obj): boolean //all attributes inherited+local must match for 2 Staff objects to be considered equal + toString(): String //"<content of Employee> GeneralStaff: Duty: %10s”, duty Note: do not override the inherited compareTo from the Employee class (use as is) Student: extends Person - numStudents: static int - studentID: int - courses Taken: Course[ ] - numCourses Taken: int - is Graduate: boolean - major:String + Student() //generated //initialize to length of 50 //controlled variable //"undeclared" default value /// courses Taken = [], numCourses Taken = 0, is Graduate = false + Student(boolean is Graduate) + Student(String major, boolean is Graduate) + Student(String name, int birth Year, String major, boolean isGraduate) + is Graduate():boolean + getNumCourses Taken(): int + static getNumStudents(): int + getStudentID(): int + getMajor(): String + setlsGraduate(boolean isGraduate): void + setMajor(String major):void + addCourse Taken (Course course): void + addCourses Taken (Course []) courses): void array + getCourse Taken(int index): Course invalid + getCourse TakenAsString(int index): String invalid + getAllCourses TakenAsString(): String method + equals(Object obj): boolean objects to be considered equal + toString(): String //appends course to the end of the existing array //appends courses to the end of the existing // note: index must be verified. Return "null" if 6699 // note: index must be verified. Return “” if // returns "courseDept-courseNum❞ // comma separated list of all courses taught // uses getCourse Taken AsString(int index) as a helper //all attributes inherited+local must match for 2 Student //"<content of Person> Student: studentID: %04d | Major%20s | %14s | Number of Courses Taken: %3d | Courses Taken: %s", studentID, major, Graduate/Undergraduate, numCourses Taken, getAllCourses TakenAsString() + compareTo(Person p): int numCredits //use the Comparable interface specification, sort by OBJECTIVES & GRADING RUBRIC: To earn a grade, the project video must be submitted as described in the submission instructions below. 1. (5 pts) Course class completed as per UML and passes zybook test cases 2. (5 pts) Person class completed as per UML and passes zybook test cases 3. (5 pts) Employee class completed as per UML and passes zybook test cases 4. (5 pts) GeneralStaff class completed as per UML and passes zybook test cases 5. (10 pts) Faculty class completed as per UML and passes zybook test cases 6. (10 pts) Student class completed as per UML and passes zybook test cases 7. (5 pts) Fields of all classes completed as per UML and confirmed via zybook test cases 8. (5 pts) Read from file (the path and filename should be "SchoolDB_Initial.txt") 9. (5 pts) Display the plain text file content on the console 10. (5 pts) Create the Objects as specified from the file content 11. (5 pts) Using the toString() method of each object, display all the objects to the console in the following order (See sample output below): All Course objects • All Person objects • All Employee objects • All GeneralStaff objects ⚫ All Faculty objects • All Student objects 12. (25 pts) Create a menu that will interact with the user and do the following: a. (3 pts) Create 3 new Course objects based on input b. (3 pts) Create 3 new Faculty objects based on input c. (3 pts) Create 3 new GeneralStaff objects based on input d. (3 pts) Create 3 new Student objects based on input e. (2 pts) Add 2 new Courses to a Faculty object f. (2 pts) Add 2 new Courses to a Student object g. (1 pts) Add an array of 2 Courses to a Faculty object h. (1 pts) Add an array of 2 Courses to a Student object i. (1 pts) Get the Course at index (valid and invalid indexes) from a Faculty object j. (1 pts) Get the Course at index (valid and invalid indexes) from a Student object k. (1 pts) Allow the user to select a Faculty object and a Course object from menus and query the Faculty object for the Course to determine whether the Faculty object teaches it or not. I. (1 pts) Determine which Faculty object teaches the most and the least courses. m.(1 pts) Determine which Course is the minimum of all Course objects in the catalog. n. (1 pts) Determine which Course is the maximum of all Course objects in the catalog. o. (1 pts) Determine which Student has the most and least credits. 13. (5 pts) Display all the Objects using toString on the console (this includes existing plus recently added) 14. (5 pts) Write all of the Object details to a plain text output file using the same format as the input file SUBMISSION INSTRUCTIONS: 4. Submit your source code to zybook for grading using the test cases that have been provided for the project. (65 points) 5. Record a 5-10 minute video of the project running through the steps to demonstrate the functionality as you explain it. (35 points) Explain the code in depth and cover all points from the rubric in order. 6. Upload your video to youtube and provide the link as a comment in your code at the top of the Driver_SchoolDB java file. (The visibility of your video must NOT be private. It CAN be unlisted) NOTE: Video explanation and code must both be submitted by the deadline to earn credit, even if the program is not fully functional.See Answer
    • Q10: CS 3305: Data Structures (100 points total) Assignment 9 - AVL Trees GENERAL SUBMISSION REQUIREMENTS Upload all files individually as specified, not as zip files, to Assignments in D2L. Do not email files. Make sure your program compiles, runs and produces the correct output. Ensure you have the correct file name(s), and author header, as specified in the Assignment. Always use meaningful labels for prompts, inputs, and outputs. Always use comments, indentation and whitespace as shown in examples. Note: Never hard-code test data in the test program, unless explicitly stated in the assignment. Always allow the user to enter the test data using a menu option. Assignment 09 - PART 1 Draw AVL Tree (50 points): Objective of this assignment is to reinforce understanding of AVL Trees. You will draw an AVL Tree on paper, given the following events: Begin with an empty AVL Tree Insert the following integers, in this order 8, 26, 49, 14, 1, 20, 35 Show the resulting tree after each insertion, and 1. make clear any rotations that must be performed, 2. show the resulting tree after that rotation Note: This is a different format for the deliverable. You may draw your AVL Trees by hand on paper and then scan the images into a word document. Phones have great scanning apps. Save doc as a file named, LastName-A9-Part-1-DrawAVL.docx or .pdf and submit it to D2L. Assignment 09 - PART 2 AVL Tree (50 points): Objective of this assignment is to reinforce understanding of AVL Trees. You may use the Java Libraries for solving this problem. No files or data are provided for this part of the assignment. Please note, the following errors in the Text Book, listing 25.5 for BST.java: (1. On Page 938, line 89, the method name preorder should be postorder. 2. On Page 938, line 102, the method name postorder should be preorder.) Write a complete test program to test if the AVLTree class in Listing 26.3 on page 972 of the Liang textbook meets all requirements of an AVL Tree. Note you have additional class dependencies as follows: AVL extends BST, BST extends AbstractTree and AbstractTree implements Tree You will need the following files Tree.java // listing 25.3 AbstractTree.java // listing 25.4 BST.java // listing 25.5 Do not forget to include author header in each submitted file as shown, no header, no points! / // Name: // Class: // Term: Instructor: Assignment: <your name> CS 3305/ put your section number after the / Spring 2023 Carla McManus 9-Part-2-AVL Capture a READABLE screenshot(s) of your program output and paste into a word/pdf document. Readable means readable! Screenshots should not be an entire desktop - use some type of snipping tool. After your output screenshots, copy and paste the source code for your program into the word/pdf doc. Make sure that the source you've copied and pasted into your word/pdf is the same as that in your .java source file that you will upload to D2L. Save doc as a file named LastName-A9-Part-2-AVL.docx or .pdf. Last step is to upload word/pdf and java files to D2L. MAKE SURE YOUR CODE HAS COMMENTS! We are getting submissions without comments in the code. No comments = ( -20 ) points per Part of the assignment Do not submit zip files. Late penalties of 10 % per day are in effect for this assignment.See Answer
    • Q11: Week 16 Final Project - Shuffle Deck It is time to show off all of your incredible talent and all that you have learned by programming a simple card game, we will use the concept of poker, but without actual cards. You will have three separate, or internal classes that will: 1. Instantiate a Card 2. Instantiate a Deck of those Cards, and shuffle and deal them. 3. Play the game. In this project you will simulate the playing of a simple card game. You are given a Card and Deck class to use. The Card class should not be changed or renamed, I will use my own Card class when testing your files. This assignment should be submitted in two classes; Main+lastName, Deck+lastName, or using internal declared classes, but will not be referenced in this manner henceforth. The first class, Deck, will be a modification of the class I have provided. You will need to implement the shuffleDeck method in order for this class to be usable, which has already been written for you in a method. The second class, Main, will use the Card class and your modified Deck class to create a shuffled Deck object and deal the two hands. The hands should be dealt in alternating order, starting with the first hand. As the cards are dealt into each hand they should be removed from the deck. For example, each hand is shown for the following Deck. designing your game. Then, you should plan the algorithms that you will design. Use the following table to plan your program. Card/Deck Methods & Variables Main Card - Methods & Variables • String suit, String rank, int pointValue ⚫public Card(String cardRank, String cardSuit, int cardPointValue) ⚫ public String suit() ⚫ public String rank() ⚫ public int getPointValue() public boolean matches(Card otherCard) ⚫ public String toString(); use to print each card with a for each Deck - Methods & Variables private ArrayList<Card> deck; ⚫ constructor method; instantiate deck ArrayList object, populate elements with cards by calling initialization method, and shuffle it by calling shuffle Deck() (written for you). ⚫ method to initialize the deck with 52 cards and set their point values; Ace of Clubs through King of Spades. ⚫ method to return the top card from the deck and remove it from the stack; return type should match what you are returning. Main.main instantiate a new Deck object based on Card element types • establish two arrays, one for each hand to be dealt ⚫deal 5 cards to each hand calling the getTopCard() method from Deck{} total up the values for each hand using getPointValue() from Card{} display the cards and their point values for each hand ⚫ determine the winning hand and display You do NOT need to hand in Card, nor customize the class or the instantiation usage of Card in Deck or Main! But you still need to change Deck and Main to include your last name. PLAGIARISM will earn a ZERO! Copying someone else's code online, with the highest point value wills. In the case of a law, the second hand wins. In this game ace = 1, jack = 11, queen = 12, and king = 13. In the deck the card in the first position (index 0) is the top of the deck. Lastly, Main will declare the winning hand. See the following sample run for the exact format that will be expected. Sample Run of Main: = = 3) 2) Hand 1: Total points 22 three of clubs (point value two of clubs (point value six of hearts (point value = 6) ten of hearts (point value 10) ace of spades (point value = 1) = Hand 2: Total points 27 four of spades (point value = 4) ten of clubs (point value = 10) three of diamonds (point value eight of diamonds (point value = 8) two of hearts (point value = 2) Hand 2 wins Play again (y/n)? = 3) To plan for the program, you should review the given classes. Knowing which methods are available to you will be very helpful in designing your game. Then, you should plan the algorithms that you will design. Use the following table to plan your program. Card/Deck Methods & Variables Main Card - Methods & Variables • String suit, String rank, int pointValue ⚫ public Card(String cardRank, String cardSuit, int cardPointValue) ⚫public String suit() ⚫ public String rank() ⚫ public int getPointValue() ⚫ public boolean matches(Card otherCard) ⚫ public String toString(); use to print Main.main • instantiate a new Deck object based on Card element types • establish two arrays, one for each hand to be dealt DOOR GIRO DI TUTTI D joc une More Cho nu The hands should be dealt in alternating order, starting with the first hand. As the cards are dealt into each hand they should be removed from the deck. For example, each hand is shown for the following Deck. seven of spades queen of spades ten of spades eight of spades three of spades king of hearts queen of hearts jack of clubs four of clubs eight of clubs king of diamonds seven of hearts <- Index 0, top card <Index 1, etc. Hand 1: Hand 2: seven of spades queen of spades ten of spades eight of spades three of spades queen of hearts king of hearts jack of clubs eight of clubs four of clubs Each of these cards should be removed from the deck. After dealing the hand, Main should use the point value attribute of each card to calculate the total point value of each hand. The hand with the highest point value wins. In the case of a draw, the second hand wins. In this game ace = 1, jack = 11, queen = 12, and king = 13. In the deck the card in the first position (index 0) is the top of the deck. Lastly, Main will declare the winning hand. See the following sample run for the exact format that will be expected. Sample Run of Main: Hand 1: Total points 22 three of clubs (point value = 3) two of clubs (point value = 2) six of hearts (point value = 6) ten of hearts (point value = 10) ace of spades (point value = 1) Hand 2: Total points 27 DOOR GIRO DI TUTTI D joc une More Cho nu The hands should be dealt in alternating order, starting with the first hand. As the cards are dealt into each hand they should be removed from the deck. For example, each hand is shown for the following Deck. seven of spades queen of spades ten of spades eight of spades three of spades king of hearts queen of hearts jack of clubs four of clubs eight of clubs king of diamonds seven of hearts <- Index 0, top card <Index 1, etc. Hand 1: Hand 2: seven of spades queen of spades ten of spades eight of spades three of spades queen of hearts king of hearts jack of clubs eight of clubs four of clubs Each of these cards should be removed from the deck. After dealing the hand, Main should use the point value attribute of each card to calculate the total point value of each hand. The hand with the highest point value wins. In the case of a draw, the second hand wins. In this game ace = 1, jack = 11, queen = 12, and king = 13. In the deck the card in the first position (index 0) is the top of the deck. Lastly, Main will declare the winning hand. See the following sample run for the exact format that will be expected. Sample Run of Main: Hand 1: Total points 22 three of clubs (point value = 3) two of clubs (point value = 2) six of hearts (point value = 6) ten of hearts (point value = 10) ace of spades (point value = 1) Hand 2: Total points 27See Answer
    • Q12: Instructions there are two zip files within this, one is tictactoe game and one is the wordsearch game. The tictactoe game is complete and needs to be used as reference to complete wordsearch game. There is a test file inside src/test folder called "WholeGameTest.java". A similar test file needs to be implemented for the wordsearch game. Please do it and follow same procedures as the WholeGameTest.java but just change accordingly to the requirements of the wordsearch game. All the requirements for the wordsearch game are in "Project Requirements.pdf" and any additional notes are in "additional requirements.txt". Please use all the code available in wordsearch.zip to help you understand the game and show you how the test file needs to be implemented. Please thoroughly read through the requirements pdf and follow everything accurately, student note: we need to use tictactoe game as a reference to do the "wordsearch game most of the things implemented in tictactoe are implemented similarly in wordearch. most of wordsearch is basically done mainly it is the testing part that is left there is a test file in tictactoe called "WholeGameTest.java" a "WholeGameTest.java" needs to be made for wordsearch too it needs to be implemented similarly to that of tictactoe but with changes according to requirements of wordsearch Project design and Project implementation has been done but need to keep an eye on the project implementation part as some parts may still need some small refinements its just so testing can be implemented accordingly work needs to be done in Java, needs to be junit framework like all the other test files **this is what it says in the pdf** Making Manual Test procedures: • Identify a scenario or a 'user story'. An example would be "two-person game with horizontal words" or "three-person game where one of the three disconnects" ● Identify all requirements from the Requirements spreadsheet you intend to test with this test. . Write step by step instructions to follow the scenario, to include "Action", "Expected Results", and "Actual Results". (The "Actual Results" are written when the test is executed, as such they are blank in the instructions. Annotate the specific requirement being verified when you come to a step or a series of tests that test the requirement. (Note: A spreadsheet can be used for this) ask the tutor if they can just write comments on what parts they have implemented just to put it in a spreadsheetSee Answer
    • Q13: Stat Slam: Dunking into NBA Data A Slam Dunk Analysis of Basketball Player Performance Description of Problem Context In the fast-paced world of professional basketball, knowing what makes players successful on the court is crucial. With tons of stats available, it's tough to figure out which ones really matter. That's where Stat Slam comes in. We're diving into the 2022-2023 NBA regular season data to uncover what factors influence player performance and team success. Motivation for this Problem Libby I am interested in learning more about professional basketball. It is one of the only professional sports I do not follow, and I think this project would be a fantastic opportunity to see if I like sports data analytics. Mika As a high schooler I had a summer job where I would keep stats for Nike's Elite Youth Basketball tournaments around the country. Doing that I would always wonder what statistics help teams win the most. With my previous experience around the game of basketball I believe this project will be fun for me to dive into. Functionality 1: Players Stats and Minutes Played Analyzing NBA players' performance goes beyond basic stats. This exploration utilizes player data to predict their rebounds, assists, points, and steals per game based on average minutes played. We will build a Random Forest Regression model using Java libraries. This model is better suited than linear regression for capturing the non-linear relationship between minutes played and these stats. While factors like talent and opponent strength influence performance, this approach provides a data-driven analysis to estimate a player's potential based on average minutes played. Functionality 2: Win Share Data for Players We can use a multi-step approach in Java to estimate a player's Win Shares (WS), a metric of their contribution to winning. First, we'll create new features by combining existing stats (FG%, rebounds, etc.) to capture aspects like scoring efficiency or rebounding rate that might influence wins. Then, we'll build a Random Forest Regression model, a prediction tool. This model will be trained on existing player data, but instead of using actual Win Shares, it will learn the relationships between stats and Win Shares using a formula like John Hollinger's (The creator of the original win share formula). By analyzing these patterns, the model can predict Win Shares for new players based solely on their provided stats. Remember, this is an estimate of a player's true impact on winning depends on various factors beyond just individual stats. Supporting methodologies, steps, functionalities Data Cleaning and Preprocessing: To ensure the reliability and accuracy of our analysis, data cleaning and preprocessing procedures will be employed. This includes handling missing values, removing duplicates, and standardizing formats. Making our data clean and tidy. Interface Development using Vaadin: Vaadin will play a pivotal role in creating an interactive user interface for Stat Slam. The interface will feature a grid displaying NBA player statistics, providing users with a comprehensive overview of the dataset. Additionally, two text boxes. One will enable users to search for a player of interest on the grid. Two buttons, corresponding to each functionality, will allow users to generate the models. Utilization of Random Forest: For Stat Slam's analysis of NBA player performance, we will utilize Java libraries to implement Random Forest Regression models for the two functionalities. First, predicting player metrics like rebounds, assists, points, and steals per game based on average minutes played, employing data preprocessing steps for reliability. Second, estimating Win Shares using a multi-step approach, including feature engineering to capture performance aspects, and training a Random Forest Regression model on existing player data. Our Data set https://www.kaggle.com/datasets/vivovinco/20222023-nba-player-stats-regular (regular season not playoffs)See Answer
    • Q14: Touchstones are projects that illustrate your comprehension of the course material, help you refine skills, and demonstrate the application of knowledge. You can work on a Touchstone anytime, but you must pass this unit's assessments before you submit it. Once you've submitted a Touchstone, it will be graded and counted toward your final course score. Touchstone 4: Final Java Project ASSIGNMENT: For this Touchstone, you will learn how to effectively plan, design, develop, and test an original program of your choosing. This program is your choice and it can be as complex as you wish. The goal is to start with an idea for your program and then step through the process of most phases of the development lifecycle to turn your idea into an actual program. This includes planning out the algorithm using pseudocode, coding your program using everything you learned from Units 1-3, and finally, testing and debugging your program to make sure it fulfills your intended purpose. You will fill out a journal (template link below) which has five sections that correspond to the five steps you will complete for your final project. Use this template to write your journal responses for each section of the project. When you have finished, you will submit this journal as a Word .doc/docx. Java Journal Template The following Example Java Journal Submission will be helpful to you as you work on this assignment and shows acceptable submissions for each entry. Example Java Journal Submission Being able to create your own program can be beneficial in any career field. Anything that can be programmed or automated in any industry could make your work a lot easier. Even as a hobby, it can give you a reference point to have a better understanding of how to deal with common issues. Using basic Java to automate menial tasks can save you time and money! Whether you were in this class to learn programming at a professional level or if it's just for fun, you will benefit from learning coding as a foundation of your technical skills. In order to foster learning and growth, all work you submit must be newly written specifically for this course. Please note that you cannot use the same program used in a previous programming course. Any plagiarized or recycled work will result in a Plagiarism Detected alert. Review Touchstones: Academic Integrity Guidelines for more about plagiarism and the Plagiarism Detected alert. For guidance on the use of generative Al technology, review Ethical Standards and Appropriate Use of Al. A. Directions Step 1: Download Template Download and review the Java Journal Template. Step 2: Review Requirements Review Section C (Requirements) to get acquainted with the requirements for this Touchstone before you begin writing your journal entries. Step 3: Complete Journal Follow the directions for each part of the journal template. Make sure to include in your response all the elements listed under the Requirements section. Prompts in the Inspiration section are not required; however, they may help you to fully think through your response. Follow the journal creation process that is presented in your Unit 4 lessons to ensure you write a thorough journal entry. There is also an example of a successful journal entry for each submission in the Assignment description above. Review Section B (Rubric) to make sure you have an understanding of how each journal entry will be graded. Step 4: Submit Journal Once your journal is complete, including the code link, submit your journal for grading. HINT There are helpful tips on "How Do I Submit My Java Journal?" in the first lesson of Unit 4, Java Touchstone Overview. Refer to the checklist below throughout the writing process. Do not submit your Touchstone until it meets these guidelines. PART 1: Defining Your Problem Did you describe the problem you are trying to solve? Did you describe any input data you expect to use? Did you describe what the program will do to solve the problem? Did you describe any outputs or results the program will provide? PART 2: Working Through Specific Examples Did you write down clear and specific steps to solve a simple version of your problem you identified in Part 1? ☐ Did you state any necessary input data for your simplified problem? Did you write clear and specific steps in English (not Java) detailing what the program will do to solve the problem? ☐ Did you describe the specific result of your example/scenario? PART 3: Generalizing Into Pseudocode Did you write out the general sequence your program will use, including all specific examples/scenarios you provided in Part 2? ☐ Did you write pseudocode for the program in English but refer to Java program elements where they are appropriate? Does the pseudocode represent the full functionality of the program, not just a simplified version? ☐ Is the pseudocode broken down enough that the details of the program are no longer in any paragraph form? PART 4: Testing Your Program While writing and testing your program code, did you describe your tests, record any errors, and state your approach to fixing the errors? For at least one of your test cases, did you describe how your choices for the test helped you understand whether the program was running correctly or not? ☐ For each error that occurs while writing and testing your code, did you record the details of the error from Replit? Did you describe what you attempted in order to fix the error? PART 5: Commenting Your Program Did you submit your full program code, including thorough comments describing what each portion of the program should do when working correctly? ☐ Are the purpose of the program and each of its parts clear to a reader that does not know the Java programming language? PART 6: Your Completed Program ☐ Did you provide the Replit link to your full program code? B. Rubric Advanced (100%) Proficient (85%) Acceptable (75%) Needs Improvement (50%) Non-Performance (0%) PART 1: Defining Your Problem (17 points) State the problem you are planning to solve. The student clearly stated the problem they are trying to solve, including what the program is expected to do to solve the problem and any necessary inputs and outputs required for the program. The student clearly stated the problem they are trying to solve, including answers to most of the required questions. The student clearly stated the problem they are trying to solve, including answers to some of the required questions. The student did not clearly state the problem they are trying to solve and/or did not include answers to most of the required questions. No problem was identified and/or no details were given for the expected solution. PART 2: Working Through Specific Examples (17 points) Write down clear and specific steps to solve a simple version of the problem you identified in Part 1. The steps to solve the problem are in English and easily understood and appear in logical order. The journal entry fully satisfies the requirements. The steps to solve the problem are in English and easily understood and appear in logical order; however, some minor steps may be missing. The journal entry mostly satisfies the requirements. The steps to solve the problem are in English but may not be in logical order or may be missing some steps. The journal entry barely satisfies the requirements. The steps to solve the problem are in English but highly illogical, confusing, or missing critical step(s), and/or the journal entry does not satisfy the requirements. No steps were provided in English and/or no answers to the required questions were submitted. PART 3: Generalizing Into Pseudocode (17 points) Write out the general sequence your program will use in pseudocode, including all specific examples you provided in Part 2. The pseudocode submitted encapsulates the full functionality of the program and includes common program elements. The pseudocode is clearly laid out and readable to a person that does not know Java. The pseudocode submitted encapsulates most of the functionality of the program, including common program elements. The pseudocode is clearly laid out and readable to a person that does not know Java. The pseudocode submitted encapsulates most of the functionality of the program, including common program elements. However, the pseudocode is not clearly laid out and readable to a person that does not know Java. The pseudocode submitted does not encapsulate the functionality of the program to include common program elements. The pseudocode is also not clearly laid out and readable to a person that does not know Java. No pseudocode was submitted and/or the pseudocode submitted was not understandable. PART 4: Testing Your Program (17 points) While writing and testing your program code, describe your tests, record any errors, and state your approach to fixing the errors. Entry consists of a thorough explanation of the testing utilized and why, recording the error(s) found and the approach to fixing the error(s) for each of the test cases. Entry consists of a thorough explanation of the testing utilized, including answering most of the required questions. Entry consists of a thorough explanation of the testing utilized, including answering some of the required questions. Entry does not give a thorough explanation of the testing utilized and/or does not include answers to the required questions. No testing explanation was provided and/or no answers to the required questions were submitted. PART 5: Commenting Your Program (17 points) Submit your full program code, including thorough comments describing what each portion of the program should do when working correctly. The provided code in the journal entry includes comments that thoroughly describe the program flow to a degree that a non-programming individual can easily follow the steps and conclude the outcome of the program. The provided code in the journal entry includes comments that describe the program flow to a degree that a non-programming individual should be able to follow the steps and conclude the outcome of the program. There could be some additional comments needed or added clarity. The provided code in the journal entry includes some comments on the program flow that may not be clear to a non-programming individual and/or may be missing some comments that would make the flow easier to understand. The provided code in the journal entry includes minimal comments to explain the program flow and/or is missing comments that would make the program easy for a non-programming individual to be able to follow the steps and conclude the outcome of the program. The provided code in the journal entry did not include comments and/or comments provided do not provide any description or clarity on program flow. PART 6: Your Completed Program (20 points) Provide the Replit link to your full program code. The program works as expected. No errors present. Any required user input executed correctly. Output was as expected. Performance level not used. Performance level not used. Program did not work as expected; however, detailed comments were given as to why the student felt it did not run, including testing efforts. No link to a program was submitted for testing. C. Requirements The following requirements must be met for your submission: Use a readable 11- or 12-point font. Journal entries must be original and written for this assignment. All writing must be appropriate for an academic context. Follow academic writing conventions (correct grammar, spelling, punctuation, and formatting). Plagiarism of any kind is strictly prohibited. Submission must include your name and the date (included in the template). Include all of the journal parts in a single .doc and .docx file. Include your Replit share link at the appropriate location in the journal template.See Answer
    • Q15: IN2011 Computer Networks: Coursework 1 This coursework assesses your ability to use what you have learnt about networking to build functioning software that interacts with network services. This includes the following: • Understanding the IP network layer and TCP transport layer. • Being able to read and understand the specification of a application layer protocol. • Using Java to implement the application layer protocol. • Use cryptographic hashes. Because this is a second year unit, we will assume that you have the following skills from the first year: • Can write Java programs up to a few hundred lines long. • Be able to test your software so that it is robust against a range of inputs and errors. • Be able to build and run your software on a variety of different operating systems and configurations. • Understand what a hash table is and how they are used. • Understand how a number or a string of bytes can be represented using hexadecimal. • Perform bit-wise comparisons on arrays of bytes. You will not get marks for these but you need to know them to do this course- work. If you do not feel confident about these please revise your notes from last year and talk to the staff running your practical sessions or your personal tutor. 1 1 Tasks Download the 2D#4 RFC and read it carefully. • Download the starting git repository, unzip it and carefully read the code. • Complete TemporaryNode.java so that it can: - Act as a temporary node as described in the RFC. Connect to the 2D#4 network using the name and address of a starting node. Search the network to find the full node with a hashID closest to a given hashID. Can store a (key, value) pair in the network. Given a key, can find the value from the network. • Complete FullNode.java so that it can: - Act as a full node as described in the RFC. Connect to the 2D#4 network using the name and address of a starting node and notify other full nodes of its address. Handle inbound connections. Handle all requests and respond appropriately, including storing (key, value) pairs Build and maintain a network map. • Submit a zip file containing: 1. Your version of the git repository including the two classes you have to implement. Do not include class or binary files. If you have create any other objects or project files that are needed to build and run your submission these must be included. It must be able to be built and run on the course virtual lab machine. 2. A README.txt file that gives: - - All of the instructions needed to build and run your objects. Which functionality you think is complete and working. 3. A Wireshark recording of your code working and interacting with the test network. 2 2 Mark Scheme This is individual coursework. The programs that you submit must be your work. You must not use generate AI tools to create the code for you. You must not share your code with other students. You must not make your code available to other students such as by making it a publicly accessible github repository. When using the test network, your code may interact with other student's programs. This is acceptable as a form of testing. Part of the assessment of your two objects will be automated. Your objects will be used in a larger system. For this it is vital that you: ● Submit Java files that build on the course virtual lab machines. • Test your code so that it does not crash. • Do not alter any of the code marked as DO NOT EDIT. This is your responsibility and you will loose marks if you do not do so! Submissions will be marked out of a total of 50. Marks will be awarded for the following: Temporary Node.java • Connect to the 2D#4 network (3) ● Find the full node with the hashID closest to the given hashID (3) • Store a (key, value) pair correctly handling all responses (3) • Given a key, find the value from the network (3) FullNode.java ● Connect to the 2D#4 network and notify other full nodes of your address (1) • Accepting incoming connections (3) • Respond to ECHO? correctly (1) • Respond to PUT? correctly (3) • Respond to GET? correctly (3) • Passive mapping of the network (3) • Respond to NEAREST? correctly (3) • Active mapping of the network (3) node's 3 Wireshark Does your recording show all of the features working correctly (5) Robustness and Quality A final (13) marks will be awarded for code quality and robustness. This includes handling of error conditions, network faults and protocol errors. 3 Deadline Sunday March 24th 2024 17:00 Wednesday April 3rd 2024 23:00 4 4 Hints • There will be a number of nodes running on the virtual lab network. Use these to test that your code works and to record your program working. • When understanding the RFC, you can use netcat to interact with the nodes running on the test lab. If you don't know how to start then see if you can try to do what TemporaryNode.java and FullNode.java need to do by hand using netcat. Once you understand the protocol it should be straight-forward to write the code. • There are three testing programs which show how the objects you are creating can be used. You don't have to use these but they may make your testing easier. • You can also use netcat to send the contents of a file via a TCP connection which allows you to automate testing to some degree. • The course virtual lab machines has a command sha256sum which allows you to compute the SHA-256 sum of any file. 5See Answer
    • Q16: CS2201 Spring 2024 Assignment No. 9 Honor Statement: By submitting this homework under your personal Brightspace account, you attest that you have neither given nor received unauthorized aid concerning this homework. That includes not searching the web for solutions nor using LLM AI tools. You further acknowledge the instructors are the copyright owners of this HW. Any posting/uploading of HW questions for distribution (e.g., GitHub, Chegg) will be considered an honor code violation (even after finishing this class) and submitted to the honor council. Reminder: this assignment is less than 4% of your grade... not worth the risk of getting caught cheating. Purpose: This project is meant to give you experience in creating and using a tree-like ADT to store words. In particular, you will implement a Trie ADT, as described in class. A trie is a kind of tree that stores sequences of data in such a way that makes searching efficient. The word trie comes from reTRIEval, but is pronounced "TRY" to distinguish it from other kinds of trees. Assignment: Implement a Trie ADT that will hold a collection of words. Requirements: 1. The files to be submitted include: Trie.java, and if appropriate TrieNode.java. Also submit a program TrieTest.java that contains JUnit test code that thoroughly exercises all functionality of your Trie. Also submit a README document (a .txt text file or a .doc Word document) that answers the questions listed later in this document. The functional specification for the Trie ADT is given below. 2. Your implementation must use a linked-tree structure modeled on the diagram at the end of this document. There are two options that you can choose between, and those are described later. 3. All class methods should be properly documented with Javadoc header comments. Each code file should start with the standard header comments, including an honor statement. Functional Specifications: Trie: This class will provide support for holding a collection of words (in the form of a trie). must support the following public operations: Trie() void insert (String word) void loadFromFile (String filename) boolean isWord (String word) boolean isPrefix (String str) String toString ( ) int wordCount ( ) Trie clone () boolean equals (Object other) The default constructor Insert the parameter word into the Trie Insert all words in the specified file into the Trie. Throws a FileNotFoundException exception if the specified file cannot be opened (note: that exception will be thrown when you attempt to create a Scanner object on a File object for a nonexistent file). Returns true if word is in the Trie, else returns false Returns true if str is a prefix of a word in the Trie, else returns false Return a string of all words in the Trie, in dictionary/alphabetical order. Each word in the string is followed immediately by a newline character '\n'. Returns a count all the words in the Trie Return a clone/copy of the Trie. Determine equality of two Tries. Two Tries are equals if they contain the exact same collection of words. You are required to determine equality by comparing the two Tries and not by converting them to strings and performing string comparison. As discussed in class this assignment can be greatly simplified by creating a TrieNode class, just as we created a BinNode class for our Binary Search Trees. Here is the specification of the TrieNode class. TrieNode: This class will provide support for one node in the trie tree, which equates to a single letter. It should support the following public operations: TrieNode (char letter, boolean flag) void insert (String str) boolean isWord (String str) boolean isPrefix (String str) String toString (String pre) int wordCount ( ) TrieNode clone ( ) boolean equals (Object other) The alternate constructor. Takes a character for the node, and a boolean flag indicating whether it represents the end of a word. Note, there is no default constructor. Insert str starting with the given TrieNode. Create new TrieNodes as needed and be sure to set the boolean flag on the last node to true. Returns true if str is in the sub-Trie starting at the given TrieNode, else returns false Returns true if str is a prefix of a word in the sub-Trie starting at the given TrieNode, else returns false Returns a string containing all words starting at the given TrieNode. Each word is followed immediately by a newline character. The parameter string pre stores the letters of all previous TrieNode objects up to the node currently being processed. That is the letters of the TrieNodes on the path from the root to the current node. Returns a count all the nodes in the sub-Trie that end a word. Return a clone/copy of the TrieNode (and the entire sub-Trie) Determine equality of two TrieNodes. Two TrieNodes are equals if they have the same letter and same end-of-word flag, and all their children TrieNodes are equal. You are required to determine equality by comparing the two TrieNodes and not by converting them to strings and performing string comparison. TrieTest.java: This program should contain JUnit test code that fully exercises all functionality of your Trie ADT. Note: 9% of your grade will be based on the quality of your testing. README: Answer the following questions in your README document (a .txt text file or a .docx Word document). 1. List your name and email address. 2. After reviewing this spec and the provided files, please estimate/report how long you think it will take you to complete it. 3. How many hours did you actually spend total on this assignment? 4. Did you access any other reference material other than those provided by the instructor and the class text? Please list them. 5. What did you enjoy about this assignment? What did you dislike? What could we have done better? 6. Was this project description lacking in any manner? Please be specific. Here are some programming notes: 1. The trie will be used to implement a spelling dictionary, or lexicon. Each node in the trie stores one letter, a flag indicating if that letter ends a word, as well as collection of references to subsequent nodes that represent subsequent letters in a word. This collection can be created in one of two ways (you are free to choose between these two options and use the one that makes the most sense to you): a) We could use an array of 26 references to other nodes, one for each possible next letter. The diagram on the last page of the specification uses this strategy. You can easily compute the array index of a letter by using subtraction on their ASCII values. For example, to find the index of the letter stored at position i in the string variable 'word' you can use the following code: int index = word.charAt(i)-'a'; Note that the statement use a character constant (inside single quotes) and not the ASCII value of the character 'a'- using the ASCII value would be considered poor style. b) Or we could use a Map from the Java collections framework that maps a character to a reference to another node. The map would contain one entry for each next letter that actually appears in some word that was inserted. Remember that the string returned by the toString method must be in sorted order. 2. The Trie and TrieNode classes are not generic classes. They store only words made up of lower-case alphabetic characters. As such, the class declarations should not declare any generic types inside angle brackets (as we did for the BST/BinNode classes). 3. As with the BST/BinNode classes covered in lecture, the methods of the Trie class (with the exception of loadFromFile, clone, and equals) are simple calls to the appropriate TrieNode methods on the root node. Many of the TrieNode methods can be implemented as simple recursive functions. 4. You are not being provided with any starter files for this assignment. By this time in the semester, you should be able to create an IntelliJ project (or whatever IDE you use) and associated source files from scratch. Tell IntelliJ that you want to create a new project, and then specify a name & location. When you go to add new files to the project, right- click on the src folder in the Project pane (on the left), and select New, and then select that you want to add a Java class. Provide a class name and the file will be created for you. 5. Each file you turn in should have the standard block comments at the top of the file, including an honor statement. Be sure to use good programming style. All methods should be documented with appropriate Javadoc comments. 6. You are not allowed to change the public interface of the Trie class. Since a user of the Trie class will not know about the TrieNode class nor can they access your private TrieNode data, you can change the TrieNode class public interface if desired (though it is not recommended). 7. An important difference between a Trie and a BST is that an empty Trie will still contain a root node, whereas an empty BST simply contains a root reference that is nu11. Hint: think of this root node as containing references to the roots for all possible 26 first letters. This root node of the trie is special, in that it stores a space as its character value – all other nodes will contain a lowercase letter. 8. You can assume all words will contain only lower-case letters. To make your program more robust, you could change letters to lower case as you encounter them. The Character.toLowerCase() function will do that for you. 9. The diagram below shows a trie into which the following words have been added: "for fork top tops topsy toss". Note that although "to" is a valid word, it has not yet been added to the lexicon, and so the boolean flag of the 'o' node is currently set to false. If we were to add "to" to the lexicon, this field would be set to true. Note that this diagram is using the array version of TrieNode class (see note 1-a above). 10. In the diagram below, as in your program, nodes should be created only as they are needed. Initially, the lexicon contains only the root. As new words are added, new nodes are created. In particular, the array of 26 references for the children should be initialized to null for each node if you are using the array version. If using the map version, the map would be empty for a newly initialized node. 11. As you design your solutions for insert, isWord, and isPrefix, it is helpful to simulate them operating on the diagram that is included below. All operations should start at the root node. This usually helps clarify what needs to happen as you move down the tree and delete letters from your strings. Choose your recursive base case wisely, as a good choice results in more simple code than a poor choice. 12. When clone() is called on a TrieNode, its job is to make a deep copy of the structure, which means making new subtrees. Recursion makes this trivial. ' that is stored in the 13. When creating a string of all the words in the Trie, do not include the blank/space character' root node. This requires a simple conditional in the TrieNode toString() method. 14. For loading all the words from a file, create a Scanner object on a File object in the same manner that files were opened in Projects 5-8. Let the Scanner object throw an exception if the file does not exist. You may assume the input file only contains words made up of lowercase alphabetic characters. 15. A word is considered a prefix of itself. 16. Carefully consider the base case of your recursive functions that walk the TrieNodes – using the empty string can make your logic cleaner/easier. 17. The empty string is not a word, but the empty string is a prefix of all words and of itself. One should never insert the empty string into the Trie. 18. A prefix is any substring of characters that appear at the start of a word. The valid prefixes of "word" are "wo", "wor", and "word". 6699 "W", Here is a diagram of a Trie for which the following words have been inserted: for fork top tops topsy toss ... false 30 This node at the top is the root node of the Trie. It basically contains 26 pointers to the roots of the Tries for each letter. This is the array version. Об 'f' false Оо Оо O. 20 false FO r true Co 'k' 30 30 true 25 30 't' false Оо Оо 'p' true ... 18 Со Оо 15 20 true false 18 24 25 20- 20 30 30 : 'y' true Оо 'S' false 20 оо 18 ... ON 'S' true 30See Answer
    • Q17: Page 1 of 4 String Rendezvous Project 1. Complete the class StringHandoffImpl to fully implement the behavior described in the StringHandoff interface. 2. There are two projects in the zip file: "PROJ_Thread Rendezvous" and "Parallel-Common-PROJ-Thread Rendezvous". Import them both from the zip archive. a. StringHandoff. java and most of the tests are located in "Parallel-Common-PROJ-Thread Rendezvous". The Javadoc comments inside StringHandoff explain in detail the desired behavior—read this fully. b. StringHandoffImpl.java, TestUltraBasic.java, and TestStringHandoff. java are located in "PROJ_ThreadRendezvous". 3. Only modify the StringHandoffImpl.java file (and this is the only file considered when grading [you can add nested classes if you'd like to, but they must be inside StringHandoffImpl.java]). 4. Plan of attack: @Override a. Before considering anything about timeouts, multiple passers, multiple receivers, shutdown, or any of the tests marked as advanced, design and code the most basic functionality. You can enhance your code later when you've got the core part working. This is definitely the best approach. b. Every time you get a new chunk of code working, make a zip of your source folder, name the zip file something unique, and save it somewhere safe. This way you can always go back to it no matter how much your next steps accidentally mangle things. c. You should not need special classes beyond what you've seen in class. You cannot use "wait helper" utility for the project, but instead must write all the wait-notify code manually. d. the starting code for StringHandoffImpl.java has methods marked as synchronized-keep it that way. We're not using synchronized blocks for the project. e. Have the methods that don't take a timeout call the ones that do passing in a timeout of OL (zero) and keep these methods this way through your final solution: public synchronized void pass(String msg) } throws InterruptedException, ShutdownException, IllegalStateException { pass (msg, OL); @Override public synchronized String receive() throws InterruptedException, ShutdownException, IllegalStateException { return receive (OL); } String Rendezvous Project @Override Page 2 of 4 f. For now, the methods that do take a timeout should be written to check for zero and immediately throw a RuntimeException if a non-zero timeout is passed in. We'll fix this later, but it allows us to create compilable and runnable code that can get the basic functionality working without any complexity trying to deal with timeouts: public synchronized void pass(String msg, long msTimeout) } throws InterruptedException, TimedOutException, ShutdownException, IllegalStateException { if (msTimeout != 0L) throw new RuntimeException("non-zero timeout is not YET supported"); // ... @Override public synchronized String receive (long msTimeout) } throws InterruptedException, TimedOutException, ShutdownException, IllegalStateException { if (msTimeout != 0L) throw new RuntimeException("non-zero timeout is not YET supported"); // ... g. Run TestUltraBasic and get your code to work with it before moving on to the large test suite. Until you get this working, there's no point in adding any complexity. h. Run TestStringHandoff and notice the suite of tests which run in parallel. They run against separate instances of your StringHandoffImpl class, so the parallel testing does not cause any interference. i. In general, attack the tests in the order they are written. ii. iii. iv. V. The "Points" column shows how many points your code is scoring for passing tests. Ignore the "Valid" column (I need that for my debugging of your submissions) 1. The "Total Points" box near the top is out of 100, but this is just a starting score value and I look at your source code for other potential issues and subtract from there (but no matter what, I won't add deductions to bring your score below 90). Some of the "interrupt check" tests won't pass until non-zero timeouts are actually supported. Get "single item pass and receive" to work first. This is worth a lot of points and the rest won't matter unless this works. Next, get "multiple item pass and receive" to work. At this point, definitely zip up your src folder and put that zip file someplace safe. vi. Then add support for timeouts and remove the throwing of a vii. RuntimeException we added earlier and confirm that all of the "interrupt check" tests now pass. Getting everything working to this point puts your starting score at 84. This is all before you have even begun to consider multiple passers, multiple receivers, shutdown, or any of the tests marked as advanced! String Rendezvous Project This is another time to zip up your src folder and put that zip file someplace safe. Page 3 of 4 viii. Next attack multiple passers and multiple receivers. ix. After that, attack shutdown functionality. X. When all that is working, you'll be up to a starting score of 96. Definitely create a zip of your src folder and store it safely. xi. Try the advanced tests one at a time and remember that they may be really difficult to implement and/or may require some significant design changes. 5. Here's the Javadoc generated from the interface description of StringHandoff.java. Read it all carefully, it fully explains how your code needs to work: public interface StringHandoff Rendezvous String Handoff is used to pass a String from one thread to another. The passer and the receiver meet inside an instance for the hand-off. For example, if pass () is called and there is no receiver waiting, the thread calling pass () will block until a receiver arrives. Similarly, if receive () is called and there is no passer waiting, the thread calling receive () will block until a passer arrives. Timeouts Cause a TimedOutException to be Thrown For this class, methods that can timeout do not return true for success and false for timeout. Methods that take a timeout parameter (pass (String, long) or receive (long)) will throw a TimedOutException if the specified number of milliseconds passes without the hand-off occurring. If the hand-off has completed—regardless of how long it took―no TimedOutException should be thrown. A timeout value of OL (zero) is used to indicate that the calling thread should wait indefinitely for the condition to be met (never timeout). Negative timeouts should be tolerated and be treated as a very short timeout. TimedOutException is a RuntimeException. One Passer at a Time, One Receiver at a Time There can only be one thread waiting to pass at any given time. If threadA is waiting inside pass () and threadB calls pass (), threadB must throw an 11legalStateException. threadB throwing an exception should not affect threadA at all (threadA should continue waiting). Similarly, there can only be one thread waiting to receive at any given time. If threadA is waiting inside receive () and threadB calls receive (), threadB must throw an String Rendezvous Project IllegalStateException. threadB throwing an exception should not affect threadA at all (threadA should continue waiting). IllegalStateException is a RuntimeException. Shutdown Page 4 of 4 The methods that declare that they may throw a ShutdownException will do so after shutdown () has been called. The shutdown () method itself does not ever throw ShutdownException (in fact, it doesn't ever throw any kind of exception). The shutdown () method may be called multiple times and calling shutdown () multiple times must be harmless. After threadA has already called shutdown (), if threadB calls pass (String), pass (String, long), receive (), or receive (long) threadB must immediately throw ShutdownException. If threadA is waiting inside pass (String), pass (String, long), receive (), or receive (long) and threadB calls shutdown (), threadA should stop waiting and throw ShutdownException. ShutdownException is a RuntimeException. Exception Precedence Exception precedence from highest to lowest is listed below: 1. InterruptedException 2. ShutdownException 3. IllegalStateException 4. TimedOutException Example 1: while threadA is waiting, if both of these happen before threadA can re-acquire the lock to get back from wait: i) threadB calls shutdown () and then ii) threadC interrupts threadA, the result should be that threadA throws InterruptedException. Example 2: while threadA is waiting with a timeout, if both of these happen before threadA can re-acquire the lock to get back from wait: i) threadB calls shutdown () and then ii) threadA times out, the result should be that threadA throws ShutdownException. Example 3: while threadA is waiting inside pass (), if both of these happen before threadA can re-acquire the lock to get back from wait: i) threadB calls shutdown () and then ii) threadC calls pass (), the result should be that threadC should throw ShutdownException< (not IllegalStateException!) AND threadA should throw ShutdownException.See Answer
    • Q18: Data Structures and Algorithms: Assignment 1 When submitting, please zip up your entire Netbeans project (make sure you include a .jar file of Virus Simulation project) into a folder with the following naming structure: lastname_firstname_studentID.zip (using your own name and ID) and submit to the Assignment 1 zipped folder on AUT Canvas BEFORE the due date and time. Late submissions will incur a penalty. Antiplagiarism software will be used on all assignment submissions, so make sure you submit YOUR OWN work and DO NOT SHARE your answer with others. Any breaches will be reported and will result in an automatic fail and possible removal from the course. Assignment 1 project contains (see the image on the side): • Question 1 package • Question 2 package Do NOT change the packages' names. Question 1) Linked List & Bracket Evaluator (50%) The purpose of this question is to utilise a linked list to create an application to efficiently evaluate whether opening and closing bracket and brace pairs match up inside any given string in O(n) time, where n is the length of the string. All other content in the string can be ignored. Linked list must be built, and you must use your linked Projects X Files Services Assignment_1_S1_Release Source Packages Question_1 DataAnalysis.java LinkedList.java LinkedListTest.java Node.java Queue.java Stack.java Question 2 Panel.java Phone.java RepairShop.java VirusSimulation.java Test Packages Libraries Test Libraries list to implement a Stack and Queue to complete the application of Bracket Evaluator. Node Class (5%) Create a Node Class which has data and linker parts. Data part stores any type of data and nodes can be linked to each other together by their linkers named "next". Node class has a generic object named "data". which references to any types of object (the object type may be String, Integer, Float or Character). Node Class has a node object named “next” which references to another node. Node Class has an “equals” method. “equals” method takes a Node object in and returns true if the content of argument (node)'s data equals to content of current node's data. Otherwise, it returns false. Node Class has an “compareTo" method. “compareTo" method takes a Node object in and returns an int 0 if the argument node's data equals to this node's data; an int value less than O returns if this node's data is numerically less than the argument node's data or this node's data is alphabetically less than the argument node's data. Otherwise, it returns an int value greater than 0. Members Node <E extends Comparable> compareTo(Node node): int equals(Node node): boolean data : E next: Node<E> an object of data (String, Integer...) an object of data (String, Integer...) an object of data (String, Integer...) ககக data next data next data next LinkedList Class (23%) Create a LinkedList Class which builds and manages a linked list. Extra 10 marks will be given if no loops are used in this Class. LinkedList Class has a Node reference named "head" to reference to the head of a linked list. LinkedList Class has an int variable named "size" to store the size of a linked list (number of nodes). LinkedList Class has an "add" method. It takes a generic object to create a node and add to the end of the linked list. LinkedList Class has an “addHead" method. It takes a generic object to create a node and add to the head of the linked list. LinkedList Class has an “addInOrder" method. It takes a generic object to create a node and add to a linked list following the ascending numerical order if the generic object is a number. It follows alphabetical order if the generic object is a char or String. LinkedList Class has a "contains" method. It takes an element (data of a node) and returns true if the linked list contains this element (data). Otherwise, it returns false. LinkedList Class has an "getNode" method. It takes an index of a node to be retrieved and returns the node. LinkedList Class has an "getData" method. It takes an index of a node to be retrieved and returns the node's data. LinkedList Class has a “printLinkedList" method. It prints all the contains of the linked list to the console. LinkedList Class has a "remove" method. It takes an element (data of a node) as an argument and remove a node which has the same data that is passed to the method. LinkedList Class has a "remove" method. It takes an index of a node to be removed and removes the node. LinkedList Class has a "removeFromHead" method. It removes the first node from the linked list. LinkdedList Class has a "removeFromTail" method. It removes the last node from the linked list. Members LinkedList<E extends Comparable> add(E data) add(Node head, Node node) addHead(E data) addInOrder (E data) <empty> addInOrder (Node currentNode, Node newNode) contains(E data): boolean contains(Node head, Node node): boolean getData(int index): E getData(int index, Node head): E getHead: Node getNode(int index): Node getNode(int index, Node head): Node printLinkedList() printLinkedList(Node node) remove(E data) remove(int position) removeByIndex(Node head, int position) removeFromBody(Node head, Node node) removeFromHead0: Node removeFromTail: Node removeFromTail(Node node) : Node head: Node<E> size: int Part 2 Queue and Stack(10%) Queue Class (5%) Queue class manages a linked list as a queue. Queue class has an “enqueue” method. It takes a generic object and enqueues the object to a queue. Queue class has a “dequeue” method. It dequeues and returns an element from a queue. Queue class has a "getSize" method. It returns the size of the queue. Queue class has a "printQueue" method. It prints the contains of the queue to the console. Members 曰: Queue<E extends Comparable> dequeue(): E enqueue(E data) getSize(): int printQueue( queue: LinkedList<E> Stack Class (5%) Stack class manager a linked list as a stack. Stack class has an "push" method. It takes a generic object and push the object to a stack. Stack class has a "pop" method. It pops and returns an element from a stack. Stack class has a "getSize" method. It returns the size of the stack. Stack class has a "printStack" method. It prints the contains of the stack to the console. Members Stack <E extends Comparable> getSize() : int pop0: E printStack() push(E data) stack: LinkedList<E> Part 3 Bracket Evaluator (12%) Data Analysis Class DataAnalysis class checks whether brackets of a string are valid (you may use Queue, Stack or both). DataAnalysis class has an “bracketEvaluator" method. It returns true whether opening and closing bracket and brace pairs match up inside any given string. Members Data Analysis <E extends Comparable> Data Analysis (E] data) bracketEvaluator: boolean data : E All the private methods are for the students who wish to use recursion. If you may ignore those private methods. You can add more fields or methods if you need. you don't use recursion, When you finish the question 1, please run LinkedListTest to test your program. LinkedListTest will generate a report which show you your marks for question 1. Question 2) Thread: a mobile phone virus transmission simulation (50%) You need to design a virus transmission simulation. You are going to draw some icons instead of mobile phones in your simulation. The number of mobile phones can be increased during the simulation by clicking a key from a keyboard. Each phone runs as a thread. A virus starts in a random phone, and it transmits to the others in the range of 20 pixels. Infected phone needs to take to a repair shop to get repaired. Only one phone can be repaired at a time. You need to design and write "synchronized" algorithm to handle it. If the phone cannot be repaired within 500 frames, the phone will die (the phone is removed from the simulation). Design YOUR OWN GUI of the simulation. • Phone's behaviours ○ You may use the linked list from question 1 to store all the phones or you may use array to store all the phones. • ○ Mobile phones are drawn on the simulation application. (3%) Repair shop is drawn. (3%) ○ Mobile phones move randomly (2%) о Each phone runs as a thread. (5%) O о ○ An "up" arrow key is used to increase the number of phones in the simulation. (3%) Different colours for three different states of a phone (health phone, infected phone and moving to repair shop). You choose your own colour for the phones. (2%) Press "v" key to set one phone to get virus randomly. (2%) The virus transmits through network within a certain distance (distance is about 20 pixels in this simulation) (3%) After a phone get infection, simulation counts down the life span of the phone from 500 to 0. When it gets to 0, the phone will be removed from the simulation. (2%) Synchronized о You can synchronize your block of code or method. (5%) ○ о only one phone is in the repair shop at a time. (NO race conditions) (5%) You need to select an object for synchronize. (5%) O Answer the following question as comments in your Phone class (put question and your answer on the first line of your code). (8%) Question: "Which object(s) have you chosen for the synchronize? Why?"See Answer
    • Q19:Part I. Conditional Test in Flow Chart Design a flowchart and write the pseudocode (listed separately from the flowchart) for a program that accepts two numbers input from the keyboard by a user, and displays one of the following messages: * The first number is larger. * The second number is larger. * Both numbers are equal. Submit your assignment to this assignment area. To use - https://www.tutorialspoint.com/compile java online.php (Links to an external site.) OR any software that has proper shapesSee Answer
    • Q20: COM139: Software Development II CRN: 44949 (AY 2023/2024 Semester 2) Module Coordinator: Dr Dermot Kerr Assessment Overview and Schedule: This coursework is Class Exercise 2. Description Implement your own solutions to programming problems in the following pages. There are 10 questions in total worth 20 marks. You can develop your solutions using IntelliJ project provided which contains the unit tests required to ensure your solution is correct or you can build your own project in your preferred IDE using the method headers provided below. Submission of solution Note you must submit your IntelliJ project files as a zip archive to the submission area on BBL. Class Exercise 2 (20 marks) This coursework will demonstrate the application of your programming knowledge to date using methods, arrays, sorting, searching and other techniques. Using the starter code complete the methods so that each method produces the desired functionality as specified in the method description. 1. Complete the method int[] arrayMerge(int[] 11, int [] 12). This method takes as input 2 arrays which are concatenated (joined) and returns a new array. Your solution should work for any size of arrays. (2 marks for correctly functioning method). E.g., using these arrays [1,2,3,4,5] and [-6,7,8,9,0,3] the resulting array should be [1,2,3,4,5,-6,7,8,9,0,3] public static int[] arrayMerge (int[] l1, int [] 12) 2. Complete the method swap(int[] array, int posA, int posB). This method swaps two values in an int array at index posA and posB. Input parameters are int array of values and positions of elements to be swapped. Method returns void. (2 marks for correctly functioning method). public static void swap(int[] array, int posA, int posB) 3. Complete the method bubbleSort (int[] array). This method sorts an integer array using the bubblesort algorithm. Input parameter is an int array of values to be sorted. Method returns void. (2 marks for correctly functioning method). public static void bubbleSort(int[] array) 4. Complete the method selectionSort(int[] array). This method sorts an integer array using the selection sort algorithm. Input parameter is an int array of values to be sorted. Method returns void. (2 marks for correctly functioning method). public static void selectionSort(int array[]) 5. Complete the method binarySearch (int[] array, int key). This method searches an integer array using the provided key. Input parameter is an int array of values to be sorted, and int key value to be searched. Method returns an int indicating the index of the item or -1 if the item is not found. Add any helper methods you need to achieve the desired result. Remember, you will need to sort the array first using the selection sort or bubble sort. You can add the sort call to the main method if you want to sort the array. (2 marks for correctly functioning method). public static int binarySearch(int array[], int key) { 6. Complete the method linearSearch(int[] array, int key). This method searches an integer array using the provided key. Input parameter is an int array of values to be sorted, and int key value to be searched. Method returns an int indicating the index of the item or -1 if the item is not found. (2 marks for correctly functioning method). public static int linearSearch(int array[], int key) { 7. Complete the method meanArrayValue(int[] array). This method computes the mean (average) from an array. Input is an int array, output is a double value representing the computed mean (average). (2 marks for correctly functioning method). public static double meanArrayValue(int[] array) { 8. Complete the method medianArrayValue(int[] array). This method computes the median (middle value) from an (ordered) array. Input is an int array, output is a double value representing the computed median. Hint: Sort the array first, the median is then the middle value. If the middle value is 2 numbers then you should average them. Add any helper methods you need to achieve the desired result. You can add the sort call to the main method if you want to sort the array. (2 marks for correctly functioning method). public static double medianArrayValue(int[] array) { 9. Complete the method modeArrayValue(int[] array). This method computes the mode (most occurring value) from an array. Input is an int array, output is an int value representing the mode value. Add any helper methods you need to achieve the desired result. Do not modify any existing code in the program. (2 marks for correctly functioning method). public static int modeArrayValue(int[] array) { 10. The code provided below contains several errors including, 1 compile time error, 1 runtime error and 2 out of bounds exceptions. Run the code, read the console output and use the supplied unit test to help fix the errors - note code must compile for unit test to pass. (2 marks for correctly passing unit test). class Main { public static void main(String[] args) { } int[] [] grid = createBoard(5); // create 5x5 game board initaliseBoard(grid); // initialise board addShip(grid, 1, 1); // add ship at position 1,1 addShip(grid, 2, 3); // add ship at position 2,3 addShip (grid, 4, 3); // add ship at position 4,3 System.out.println("Starting board"); printBoard(grid); // display current game board // Launch torpedo at ship position 4,3 System.out.println("Attack 4,3:" + sinkShip(grid, 4, 3)); printBoard(g); // display updated game board public static int[] [] createBoard (int boardSize) { int[] [] grid = new int[boardSize+1] [boardSize+1]; return grid; } public static void initaliseBoard(int[] [] grid) { for (int row = 0; row < grid.length+1; row++) for (int col = 0; col < grid[0].length+l; col++) { grid[row][col] = 0; // initialise board } } public static void printBoard (int[] [] grid) { for (int r = 0; r < grid.length; r++) { for (int c = 0; c < grid[0].length; c++) { if (grid[r] [c] 0) // no ship System.out.print(" ~"); == else if (grid[r] [c] else == 1) // ship found System.out.print(" V"); } } System.out.print(" x"); System.out.println(); //Print new line at end of row public static boolean shipAt (int[] [] grid, int r, int c) { return (grid[r][c] } == 1); public static void addShip (int[] [] grid, int r, int c) { if (!shipAt(grid, r, c)) { grid[r] [c] = 1; } } public static boolean sinkShip (int[] [] grid, int r, int c) { if (shipAt (grid, r, c)) { } grid[r] [c] = −1; // −1 indicates sunken ship return true; else { } return false; }See Answer
    View More

    Popular Subjects for Java

    You can get the best rated step-by-step problem explanations from 65000+ expert tutors by ordering TutorBin Java homework help.

    Get Instant Java Assignment Solutions From TutorBin App Now!

    Get personalized homework help in your pocket! Enjoy your $20 reward upon registration!

    Claim Your Offer

    Sign Up now and Get $20 in your wallet

    Moneyback

    Guarantee

    Original Work

    Reports

    $20 reward

    Upon registration

    Full Privacy

    Full Privacy

    Unlimited

    Rewrites/revisions

    Testimonials

    TutorBin has got more than 3k positive ratings from our users around the world. Some of the students and teachers were greatly helped by TutorBin .

    "After using their service, I decided to return back to them whenever I need their assistance. They will never disappoint you and craft the perfect homework for you after carrying out extensive research. It will surely amp up your performance and you will soon outperform your peers."

    Olivia

    "Ever since I started using this service, my life became easy. With their expert java homework helper, I now have plenty of time to focus on more important tasks like preparing for exams. TutorBin went above and beyond my expectations by delivering excellent quality work within deadlines. My grades improved exponentially after seeking their assistance."

    Gloria

    "They are amazing. I sought their help with my assignment and the answers they provided were unique and devoid of original work. They really helped me get into the good books of my professor. I would highly recommend their service for anyone looking to do my Java homework."

    Michael

    "The service they provide is great. With their expert help with java assignment, their answers are unique and handled by professionals with 5+ years of experience—expect top quality and improved grades."

    Richard

    "They provide excellent assistance. What I loved the most about them is their homework help. They are available around the clock and work until you derive complete satisfaction. If you decide to use their service, expect a positive disconfirmation of expectations."

    Willow

    TutorBin helping students around the globe

    TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.