2.3 Write a program that allows you to create an integer array of 18 elements with the following values: int A[] = {3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0}. Perform the following computations, a.Compute the sum of elements from index 0 to 14 and stores it at element 15 b.Compute the average of all numbers and stores it at element 16 c.Identifies the smallest value from the array and stores it at element 17
2.3 Write a
a.Compute the sum of elements from index 0 to 14 and stores it at element 15
b.Compute the average of all numbers and stores it at element 16 c.Identifies the smallest value from the array and stores it at element 17
6.2 Create a Product class with Product Id & Product Name. Write a program to accept information of 10 products and store that in HashSet. Do following operations, a.Search a particular product in the HashSet.b.Remove a particular product from the HashSet by using product id.(Referbelow table for the product list)
Product Id Product Name
P001 Maruti 800
P002 Maruti Zen
P003 Maruti Dezire
P004 Maruti Alto
6.3 Implement LinkedListclass for this problema.Create an Employeeclass which will have details like EmployeeNo, EmployeeName and Address. You should pass value for EmployeeNo, EmployeeName and Addressthrough constructor.
b.Create a method addInput( ) which will add employee details to LinkedList.
c.Create method display( ) which should display all data from LinkedList using forward and reverse order using Iterator and ListIterator interfaces.d.Note:addInput( ) and display( ) should not be member functions of Employeeclass.
6.4 Create a Phone Book having user interface like,a.Add new phone book entry b.Search Phone Numberc
QuitOption i: itallows add name and Phone no.Option
ii: it must take name as input from the user and based on that it should return phone No.Option
iii: will terminate the program.Note:UseHashMap to store phone book entries
7.2 Write a stream-based program which will accept Roll Number, Name, Age and Address from user. Perform following tasks,
a.Age and Roll-no should be numeric.
b.Handle built-in exception as None of the field should be blank. Handle with custom exception
c.Ask user, whetherto write the data in the file. If answer is yes, then data is saved into a file as an object. (User can write many records in the file), otherwise terminate the current program.
d.Hint:Use Serialization
7.3Write another class to display allthe records saved into the file in the sub problem 6.2.
a.Hint:Use De-serialization
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images