
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.

Step by stepSolved in 2 steps with 1 images

- Write a simple trivia quiz game using c++ Start by creating a Trivia class that contains information about a single trivia question. The class should contain a string for the question, a string for the answer to the question, and an integer representing the dollar amount the question is worth (harder questions should be worth more). Add appropriate constructor and accessor functions. In your main function create either an array or a vector of type Trivia and hard-code at least five trivia questions of your choice. Your program should then ask each question to the player, input the player’s answer, and check if the player’s answer matches the actual answer. If so, award the player the dollar amount for that question. If the player enters the wrong answer your program should display the correct answer. When all questions have been asked display the total amount that the player has won.arrow_forward17. Create a class ShuffleCipher that implements the interface MessageEncoder, as described in Exercise 15. The constructor should have one parameter called n. Define the method encode so that the message is shuffled n times. To perform one shuffle, split the message in half and then take characters from each half alternately. For example, if the message is abcdefghi, the halves are abcde and fghi. The shuffled message is afbgchdie. (Hint: You may wish to define a private method that performs one shuffle.)arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





