Spiderman and Hiphop

In this part, you need to discuss in detail the three following topics:

  1. File management
  2. Memory management
  3. Threads or Task/Process Scheduling (you can select either topic)

You must discuss each topic in terms of concepts, issues, solutions, usage, real work examples, etc.

 

In the implementation part, you must implement the pervious discussed topics in Java:

  1. File management
  2. Memory management
  3. Threads or Task/Process Scheduling (you can select either topic)

Note:

You must screenshot and illustrate your results for each part/topic. You also must submit your Java codes on the Blackboard.

Topic 1 – File Management:

You are given a text file “namesList,” which contains a list of names. You need to read the file, store the names in a list, and then count the number of each name (Ahmed   Ali, and Muhammad). Next, you need to create a new text file using Java, order the names alphabetically, and print the name to the new created file named “newNameList.”

Hint 1:

You can read the file using Java built-in classes (e.g., BufferedReader class, Scanner class. File Reader class). To read the file, you must do the following

  1. Create a new function named “readFile.” Inside the function, you must write your code. Here is an example to create a list:

 

List<String> list = new ArrayList<>();

 

  1. Once you stored the data on the list, you now can print/show the list’s data using a Java Foor Loop.

for(int i = 0; i < 5; i++){         System.out.println(i);}

 

Topic 2 – Memory Management:

As memory in any operating system is a scarce resource (limited capacity), programmers must be able to write a code that uses the memory efficiently to improve application performance. In this topic, you must illustrate the following:

  1. Write bad codes that will use the memory inefficiently, which will result in bad performance (e.g., creating unnecessary objects, lists, etc.). Give at least 5 bad examples.
  2. Write good codes that will use the memory efficiently, which will result in optimal performance. In here, you can fix the bad codes you created.

 

There are many memories monitoring tools that you can use to view and visualize memory and CPU utilization (e.g., VisualVM). Use a tool of your choice to show memory usage statistics you obtain from running/executing your bad and good codes.

 

The following tutorial might be very helpful:

https://www.youtube.com/watch?v=pRwvx4QpUfo

https://www.youtube.com/watch?v=AHLkbqcVLvY&t=404s

 

 

Topic/question 3: Threads or Task Scheduling

In this topic, you can choose to implement either thread techniques or task scheduling. Note, we discussed threads and process scheduling in slides week 3 & 4.

 

Threads (choice 1):

Threads can be used to make your Java applications faster. They allow you to run multiple things at the same time. You must think of a good scenario for using threads in real-world, and then implement the scenario in Java. You must discuss your scenario. To create a thread in Java, you can either:

  1. Extend Thread class, or
  2. Implement the Runnable interface

 

You can follow the below steps to create threads:

  1. Create a class named MultiThreads. Inside the class, write your thread logic (variables, functions, etc.). You must create a thread ID for each thread.
  2. Now in the main class, create three threads and illustrate the difference between using one thread and three threads (screenshots and discuss your results).
  3. You need to show a case where two threads run in parallel, where each thread tries to modify a common variable at the same time (screenshots and illustrate your results). Next, try to find a way to fix this issue so that the two threads do not modify the common variable at the same time.

 

Task Scheduling (choice 2):

A single-core CPU executes its processes/tasks one by one based on a given scheduling criteria. Let us say that we have more than one task to be executed. We learned that for any task to be executed, it must be put into a Ready queue. The CPU must choose which task to execute first. As such, you are asked to code two task scheduling algorithms. The first algorithm is First come first serve (FCFS). You must screenshot and illustrate your results. The second algorithm would be either:

  1. Shorter Job First (SJF).
  2. Round Robin.

Choose one from the two above algorithms (1 or 2). For simulating/creating tasks, you can use a factorial function or a Fibonacci sequence function. You can follow the below steps to do the ask scheduling:

  1. Create a new class named “TaskScheduling” and place the function of your choice inside as a method/function.
  2. In the main class (the class you use to run the code), create two objects of your class where each object would run the same method (factorial/ Fibonacci) at the same time. Note: the objects would be assumed as tasks.
  3. You might use system time provided by Java libraries to keep track of time for each task (running time, waiting time, etc.). You can also use this time to properly implement SJF and Round Robin. To obtain the time in java, you can import “time.LocalDate.
  4. Demonstrate your scheduling algorithms using the two objects/tasks. You need to show your results (e.g., running time for each task, waiting time, etc.).
  5. Hint: A queue can be implemented in java using

 

 

You will present your project in class. You must create PowerPoint slides that summarize your work. For each group, all student members must present part of the work.

 

 

 

Calculate your paper price
Pages (550 words)
Approximate price: -

Why Choose Us

Quality Papers

We value our clients. For this reason, we ensure that each paper is written carefully as per the instructions provided by the client. Our editing team also checks all the papers to ensure that they have been completed as per the expectations.

Professional Academic Writers

Over the years, our Acme Homework has managed to secure the most qualified, reliable and experienced team of writers. The company has also ensured continued training and development of the team members to ensure that it keep up with the rising Academic Trends.

Affordable Prices

Our prices are fairly priced in such a way that ensures affordability. Additionally, you can get a free price quotation by clicking on the "Place Order" button.

On-Time delivery

We pay strict attention on deadlines. For this reason, we ensure that all papers are submitted earlier, even before the deadline indicated by the customer. For this reason, the client can go through the work and review everything.

100% Originality

At Buy An Essay, all papers are plagiarism-free as they are written from scratch. We have taken strict measures to ensure that there is no similarity on all papers and that citations are included as per the standards set.

Customer Support 24/7

Our support team is readily available to provide any guidance/help on our platform at any time of the day/night. Feel free to contact us via the Chat window or support email: support@acmehomework.com.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Buy An Essay has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.

Essays

Essay Writing Services

At Buy An Essay, we prioritize on all aspects that bring about a good grade such as impeccable grammar, proper structure, zero-plagiarism and conformance to guidelines. Our experienced team of writers will help you completed your essays and other assignments.

Admissions

Admission and Business Papers

Be assured that you’ll definitely get accepted to the Master’s level program at any university once you enter all the details in the order form. We won’t leave you here; we will also help you secure a good position in your aspired workplace by creating an outstanding resume or portfolio once you place an order.

Editing

Editing and Proofreading

Our skilled editing and writing team will help you restructure you paper, paraphrase, correct grammar and replace plagiarized sections on your paper just on time. The service is geared toward eliminating any mistakes and rather enhancing better quality.

Coursework

Technical papers

We have writers in almost all fields including the most technical fields. You don’t have to worry about the complexity of your paper. Simply enter as much details as possible in the place order section.