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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

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

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY