Suppose you are a student of East West University. You have to design a multithreaded system in java for your CSE110 course. So, you are assigned a job with following descriptions. You have to design a class NumberComputator which has a function printComposite(int n) that can take a parameter N and print the composite number from 1 to nth term. Composite numbers are the number that are not prime number. Again, create two thread class (ThreadOne, ThreadTwo) by extending the Thread class so that all of the thread should call the method “printComposite(int n)” of the NumberComputator class. Again, write a main java class named “MultiProgrammingDemo” with a main method that instantiate two objects of two threads(ThreadOne, ThreadTwo). Your task is to process and run two threads simultaneously in the main method by considering the fact that when one thread printing with the printComposite(n) function the other threads must be wait for the completion of the work the initial thread. Design a JAVA application that can perform the task as given in the above scenario.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

1. Suppose you are a student of East West University. You have to design a multithreaded
system in java for your CSE110 course. So, you are assigned a job with following
descriptions. You have to design a class NumberComputator which has a function
printComposite(int n) that can take a parameter N and print the composite number
from 1 to nth term. Composite numbers are the number that are not prime number.
Again, create two thread class (ThreadOne, ThreadTwo) by extending the Thread
class so that all of the thread should call the method “printComposite(int n)” of the
NumberComputator class. Again, write a main java class named
“MultiProgrammingDemo” with a main method that instantiate two objects of two
threads(ThreadOne, ThreadTwo).
Your task is to process and run two threads simultaneously in the main method by
considering the fact that when one thread printing with the printComposite(n)
function the other threads must be wait for the completion of the work the initial thread.
Design a JAVA application that can perform the task as given in the above scenario.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education