Create a program that takes in two words, check for equality ignoring the cases, if the words are equal the print the word in upper case with an appropriate message however if the words are different then print the two words in lower case with an appropriate message. Sample run 1: Enter two words separated by spaces: Welcome WELCOME Output: You have only entered one word: “WELCOME” Sample run 2: Enter two words separated by spaces: NUST Students Output: You have entered two words: “nust” and “students”
Given any whole number from user input, check whether it’s a positive or negative number. If the number is negative then increment it by 3 and multiply the result by 4, however if it’s a positive number then decrement by 4 and multiply it by 3. a) Create a flowchart to be followed to solve the above task b) Create a java program using your flowchart and see samples below Sample run 1: Enter a whole number: 4 Output: The Number 4 is above zero hence, Result of the calculations = 0 Sample run 2: Enter a whole number: -5 Output: The Number -5 is below zero hence, Result of the calculations = -8
Most employees earn R50 000 per year. Managers earn R20 000 extra per year. ► Most employees gjet 15 workdays leaves a year. Managers get an extra 3 days leave per year. Secretaries must work 40 per week.
Employee -name: String EmployeeDeconstructors +Employee(String) ceconstructor +oString(): String setName(String) : void + getName(): String +gotSalary(): double "getHours(): double *getteaveDays(): int HeaveApplication); void +rkl): 1. Code the classes Employee, Manager and Secretary. 2. Code an application with a main method. In this class you must code an array of type Employee with a maximum size of 20. a. Add a minimum of 10 objects to the array. You may hard-code these object values. The ob ects must be a mixture of Employee, Manager and Secretary. b. Display all the objects on the screen. Calculate, and then display the average salary of all employees. Extra Calculate and display the cost of the leave to the company for each employee.
The Airplane always needs to check with the Airport to see if it has an
available runway before it's able to take off or land. Simulate the above-
mentioned scenario using multi-threading.
Write a program which takes as input a huge array of numbers. This array is
split into n sub-arrays and n threads apply a bubble sort on each of the n
sub-arrays. Lastly, another thread merges the n sorted sub-arrays into one
with the same size as the original array. Of course, the resulting array
should be sorted.by using Multi-Threading
Write a program named: SumRange.java
This program will prompt the user for two integer values, a min and a max. Then, calculate the sum of all integers from min to max, including both. Do NOT assume that the first value entered will be smaller than the second. Make sure you check which is the smallest and largest.
Then print the result to the screen.
Here are several sample I/O-s (user input in orange bold italics):
Enter two integers, and I'll tell you the sum of all integers between the two (including both): 5 12
The sum is: 68
Enter two integers, and I'll tell you the sum of all integers between the two (including both): 10 2
The sum is: 54
Enter two integers, and I'll tell you the sum of all integers between the two (including both): -5 -10
The sum is: -45
Enter two integers, and I'll tell you the sum of all integers between the two (including both): -5 5
The sum is: 0
Write a program named: WhileLessThan.java
This program will prompt the user for an integer value greater than or equal to 10.
Write a loop which will execute as long as the user inputs a value less than 10. After getting a valid input, print the value to the screen as shown.
Sample I/O (user input in orange bold italics):
Enter an integer greater than or equal to 10: 3
Enter an integer greater than or equal to 10: 21
You entered: 21
Another sample:
Enter an integer greater than or equal to 10: -2
Enter an integer greater than or equal to 10: 9
Enter an integer greater than or equal to 10: 10
You entered: 10
================================
Write a program called AnyHellos. This program should prompt the user for an integer n, then should print the phrase "Hello World" n times. You may assume that n will never be negative. Here is an example of what the program output should look like (user input is in orange bold italics):
How many hellos?
5
Hello World
Hello World
Hello World
Hello World
Hello World
Your program should run with ANY positive integer n given as input.
NOTE: Place the user input on the new line (just use println in your prompt).