COMP228Lab6F2023_012
.docx
keyboard_arrow_up
School
Centennial College *
*We aren’t endorsed by this school
Course
228
Subject
Computer Science
Date
Apr 3, 2024
Type
docx
Pages
2
Uploaded by HighnessGoose4139
Java Programming COMP-228
Centennial College
COMP 228: Java Programming
Lab Assignment 6: Developing Multithreaded Applications using Java Multithreading API
and Collections API.
Student:
______________________________________________________________________
Due Date: December 4
th
, 20223
Purpose:
The purpose of this Lab assignment is to:
Practice multithreading in Java Applications
Practice Collections API in Java Applications
Develop a Java multithreaded application References:
Read the course’s text, ppt slides and class examples. This material provides the necessary information you need to complete the exercises.
Instructions: Be sure to read the following general instructions carefully:
-
Submit the project through the dropbox link on eCentennial
.
-
You must name your IntelliJ project according to the following rule:
YourFullName_COMP228Labnumber
Example: JohnSmith_COMP228Lab6
Each exercise should be placed in a separate package named exercise1
, exercise2
, etc.
Submit your assignment in a zip file
that is named according to the following rule: YourLastName_COMP228Labnumber.zip
Example: JohnSmith_COMP228Lab6.zip
For a pair submission
include both
full names.
Example:
JohnSmith_JaneSmith_COMP228Lab6
Apply the naming conventions for variables, methods, classes, and packages:
- variable names
start with a lowercase
character
- classes
start with an uppercase
character
- packages
use only lowercase
characters
- methods
start with a lowercase
character
Exercise 1:
Lab #6 Page 1
of 2
Java Programming COMP-228
Write a Java application that handles multiple ATM transactions (withdraw, deposit) at the same
time. Create an Account
class and implement both deposit
and withdraw
operations.
Synchronize the operations to allow thread synchronization. Use Java Runnable interface to
implement a Transaction
class. Perform withdraw
and deposit operations
in run
method. Create an AccountTest
class to test multiple transactions (threads). Use an ArrayList to create a
list of three or more Transaction objects. Use method execute
of ExecutorService to execute the
threads. Display the results.
(100 marks)
Evaluation:
Functionality
Correct
implementation
of
Multithreading 50%
Correct implementation of Collections
API
30%
Comments, correct naming of
variables, methods, classes, etc.
5%
Friendly input/output
15%
Total
100%
Lab #6 Page 2
of 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
What are the potential challenges or issues that can arise when deserializing objects in a multi-platform environment?
arrow_forward
What are the benefits of Java data encapsulation? a11
arrow_forward
1. Create a java project named AdjacencyList.
arrow_forward
Discuss the potential issues and solutions related to versioning when using Java object serialization.
arrow_forward
How does "garbage collection" work in memory management for languages like Java and C#? What is its significance in preventing memory leaks?
arrow_forward
What are the benefits of Java's garbage collection system and how does it work?
arrow_forward
How do I do this in Java language?
arrow_forward
Microsoft and Sun have had multiple open conversations over the architecture
of Microsoft's J++ and C# and Sun's Java. These topics have been raised in
open discourse. Some of these papers may be found on their own websites;
you should read a few and then analyze the implications of the discrepancies
for the delegates in writing.
arrow_forward
Linked List Question
Which of the following statements are NOT correct about the ADTs?
ADTs are only supported in Java programming language.
All implementations of the same ADT will have the same time complexity for all the operations of the ADT.
ADTs allow programmers to focus on important aspects of data without worrying about implementation details.
arrow_forward
Microsoft and Sun have had several open talks on the design of Microsoft's J++ and C# and Sun's Java. Public discourse has included these topics. Some of these papers may be found on their respective websites; you should read some of them and then analyze the differences that affect the delegates.
arrow_forward
What are the advantages of Java inheritance?
arrow_forward
1___Codex Registration SystemCodex is a new an up and coming software development company. They recently started offering programming language training programmes to willing participants. They currently offer three programming language training programmes. These are namely training programmes in Java, C# and C++. The Codex management team need an application that will be used by prospective applicants to register for one of their training programmes. They have contacted you as a Java developer to assistthem in developing this application.
Develop a Java program using NetBeans for Codex. Your program should initially display a menu to the user. The menu should have three options, namely (1) Register for a Training Programme (2) Check Registration details (3) Exit Program (see Figure 3 attached). The program should make use of two functions, registerApplicant() for registering a new applicant andsearchDetails() for searching the registrant details. The registerApplicant() function should…
arrow_forward
Socket Programming
in java
Mrs Mlimaji Mashamba is a UWC graduate who runs a successful tricycle delivery business in the city of Cape Town. She has realized that a big portion of her business costs comes from her tricyle drivers using road segments with potholes and segments where traffic cops usually stop tricycles for documents’ verification. Building around socket programming, your knowledge of Python programming, and the shortest path algorithms learnt in your second-year courses, you are tasked to propose a client/server solution to Mrs Mashamba to help her drivers “find the least cost path” when starting a trip from a collection point to delivery point in the city. The goal is to develop a system that provide Mrs Mashamba’s drivers services which are similar to Google Map but with the possibility of integrating the cost of potholes and the costs incurred by the presence of traffic cops on each segment along the path from a collection point to a delivery point as provided by…
arrow_forward
Ruby language bone lan. Output before
arrow_forward
What does Java Flight Recorder (JFR)
primarily focus on?
A. Monitoring and profiling Java
applications in real-time
B. Optimizing bytecode compilation
C. Debugging multithreaded applications
D. Managing distributed databases
arrow_forward
Three computing environments are defined here.
arrow_forward
How do I do this in Java language?
arrow_forward
What does the word "virtual machine" mean in the context of a Java class's execution environment? This virtual computer executes C code, but what is the difference between this and a genuine C-based system?
arrow_forward
Study the scenario and complete the question(s) that follow: Codex Registration System Codex is a new an up and coming software development company. They recently started offering programming language training programmes to willing participants. They currently offer three programming language training programmes. These are namely training programmes in Java, C# and C++. The Codex management team need an application that will be used by prospective applicants to register for one of their training programmes. They have contacted you as a Java developer to assist them in developing this application.
Develop a Java program using NetBeans for Codex. Your program should initially display a menu to the user. The menu should have three options, namely (1) Register for a Training Programme (2) Check Registration details (3) Exit Program (see Figure 3 below). The program should make use of two functions, registerApplicant() for registering a new applicant and searchDetails() for searching the…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- Discuss the potential issues and solutions related to versioning when using Java object serialization.arrow_forwardHow does "garbage collection" work in memory management for languages like Java and C#? What is its significance in preventing memory leaks?arrow_forwardWhat are the benefits of Java's garbage collection system and how does it work?arrow_forward
- How do I do this in Java language?arrow_forwardMicrosoft and Sun have had multiple open conversations over the architecture of Microsoft's J++ and C# and Sun's Java. These topics have been raised in open discourse. Some of these papers may be found on their own websites; you should read a few and then analyze the implications of the discrepancies for the delegates in writing.arrow_forwardLinked List Question Which of the following statements are NOT correct about the ADTs? ADTs are only supported in Java programming language. All implementations of the same ADT will have the same time complexity for all the operations of the ADT. ADTs allow programmers to focus on important aspects of data without worrying about implementation details.arrow_forward
- Microsoft and Sun have had several open talks on the design of Microsoft's J++ and C# and Sun's Java. Public discourse has included these topics. Some of these papers may be found on their respective websites; you should read some of them and then analyze the differences that affect the delegates.arrow_forwardWhat are the advantages of Java inheritance?arrow_forward1___Codex Registration SystemCodex is a new an up and coming software development company. They recently started offering programming language training programmes to willing participants. They currently offer three programming language training programmes. These are namely training programmes in Java, C# and C++. The Codex management team need an application that will be used by prospective applicants to register for one of their training programmes. They have contacted you as a Java developer to assistthem in developing this application. Develop a Java program using NetBeans for Codex. Your program should initially display a menu to the user. The menu should have three options, namely (1) Register for a Training Programme (2) Check Registration details (3) Exit Program (see Figure 3 attached). The program should make use of two functions, registerApplicant() for registering a new applicant andsearchDetails() for searching the registrant details. The registerApplicant() function should…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning