1. Create a class of SalesPersons as a thread that will display five salespersons names.
2. Create a class as Days as other Thread that has an array of seven days.
3. Call the instance of SalesPersons in Days and start both the
threads
4. suspend SalesPersons on Sunday and resume on Wednesday
Note: use suspend, resume methods from the thread
What is Thread Synchronization?
Body Mass Index (BMI) is one of the criteria that is used to calculate whether one is fit or not basing on a person’s height (m) and weight (kg). The criterion is very simple; if one’s BMI is 25 or greater, it signifies overweight. A BMI less or equal to 18.5 indicates underweight. Lastly, a BMI greater than 30 shows obesity.
You have been requested to create a program that that helps the Namibian Defence Forces’ (NDF) Captain to calculates the BMI of a person (BMI = weight/height2) and also determine whether the person has also completed running 10 km in the required time. Men should complete 10km in less than 60 minutes for them to be accepted. Women should do that under 80 minutes. Both males and females are accepted if their BMI is less than 25 and greater than 18.5. For 2018 intake, there are already 6 males selected and 1 female. The values for gender, mass and weight are enter by user inputs
create a simple program that will calculate the total amount due, accept payment, and display the change
. Given a number N, create a 2D arrays with n rows and n columns. Now inspect the matrix pattern below and come up with a formula to populate the array for any give NXN matrix.
Create a java program that initialize a two dimensional array with the continuous assessment marks used to determine the semester mark for PRG510S exam qualification, The system should also create an array of student names in correspondence to the marks (Note: the appropriate weights of each individual assessment are given under corresponding headings and both the marks and student names are read from the user input)
Output1: Student Semester mark Qualifies for Exam? --------- ------------------- ----------------------- John 66 YES Harry 50 YES Uushona 38 NO Sililo 30 NO Qualifying mark is 50 and above.
Write a java program that accepts given n number of marks for a PRG510 test, and stores them into an array named marks. After all marks have been entered your program should accomplish the following: [n - to be provided by user input] a) Find and display the highest mark b) Find and display the lowest mark c) Compute and display the average mark (Above tasks (a, b, and c should be accomplished using only one loop)
Sample Run1 Enter numbers of marks:
10 Enter 10 marks: 55 60 89 75 25 77 92 15 68 40
Output1:
Highest Mark = 92%
Lowest Mark =
15% Average = 58%
Write a java program that specifies three parallel one dimensional arrays name length, width, and area. Each array should be capable of holding a number elements provided by user input. Using a for loop input values for length and width arrays. The entries in the area arrays should be the corresponding values in the length and width arrays (thus, area[i] = length [i]* width [i]) after data has been entered display the following output: Length Width Area -------- -------- ------- 25 2.6 65.00 18.2 4.9 89.18 Sample Run1 Enter the array size: 5 Enter the Length and Width for Rectangle 1: 25 2.6 Enter the Length and Width for Rectangle 2: 18 4.9 Enter the Length and Width for Rectangle 3: 100 3.27 Enter the Length and Width for Rectangle 4: 1.84 7.4 Enter the Length and Width for Rectangle 5: 56 9.5 Output1: Length Width Area -------- -------- ------- 25 2.6 65.00 18.2 4.9 89.18 100 3.27 327.00 1.84 7.4 13.62 56 9.5 532.00
: Write a program which inputs a positive integer n and outputs an n line high triangle of '*' characters whose right-angle is in the bottom left corner
Consider an array MARKS[20][5] which stores the marks obtained by 20 students in 5 subjects. Now write a program to
(a) find the average marks obtained in each subject.
(b) find the average marks obtained by every student.
(c) find the number of students who have scored below 50 in their average.
(d) display the scores obtained by every student.