## (solution) Assignment 4 Due date: Saturday - December 12th, 2015 at 11:59

I need your help regarding attached questions

I need the solution's with explanation please.

Assignment 4

Due date: Saturday - December 12th, 2015 at 11:59 PM.

Q1:

Q1 [5 Points]

Scenario:

Write a Java program that fills an array of size 50 with random numbers between 0 and 100.

Then, find the minimum number in the array and its index. Q2:

Q2 [5 Points]

Scenario:

Write a program that takes input of names from user. Print total names number and all names.

NOTE: Solve this problem using ArrayList and Enhanced For Loop.

Typical run of the program:

Enter a name: (Q to exit)

Ali

Enter a name: (Q to exit)

Sarah

Enter a name: (Q to exit)

David

Enter a name: (Q to exit)

Enter a name: (Q to exit)

Jhon

Enter a name: (Q to exit)

q

You entered 5 names which are:

Ali | Sarah | David | Ahmad | Jhon Q4: [5 Points]

Q3

What is call by value? Explain it with an example of swapping between two numbers. Q5: [5 Points]

Q4

Scenario:

Design a class to represent Employees in a small company according to the following

requirements:

1- An employee has three attributes: name , salary and jobTitle

2- Add one constructor without parameters. In initialization of objects, Name is set to the

value ?NEW? and salary value is unspecified but it has to be an arbitrary number

between 100 and 20000.

3- Add the following methods to the class: getSalary- Returns employee?s salary.

getName- Returns employee?s name.

getJobTitle- Returns employee?s job title.

setName- Sets the employee?s name to a given value. Precondition: the number of

characters in the given name is not less than 3 characters.

setSalary - Sets the employee?s salary to a given value. Precondition: the given salary

value should be greater than 100. 4- All employees in this company have the same permanent job title: ?Accountant? and it

can?t be changed.

Solution details:

STATUS

QUALITY

Approved

Sep 13, 2020

EXPERT

Tutor