Instructions


Download 15.27 Kb.
Sana31.10.2023
Hajmi15.27 Kb.
#1736320
Bog'liq
04 Lab Assignment 2023


INHA UNIVERSITY TASHKENT DEPARTMENT OF CSE & ICE
Fall 2023 – Application Programming in Java
Lab Assignment # 4
Topic covered : Exception handling
Last Date of Submission:4/10/2023
INSTRUCTIONS:

  • Program should be well commented.

  • Program should be easy to use.

  • All Lab assignments are to be completed by an individual student on his/her computer system and not in groups

Write a program that allows a user to input integer values into a 10-element array and search the array.



  • The program should allow the user to retrieve values from the array by index or by specifying a value to locate.

  • The program should handle any exceptions that might arise when inputting values or accessing array elements.

  • The program should throw a NumberNotFoundException if a particular value cannot be found in the array during a search. If an attempt is made to access an element outside the array bounds, catch the ArrayIndexOutOfBoundsException and display an appropriate error message.

  • Also, the program should throw an ArrayIndexOutOfBoundsException if an attempt is made to access an element for which the user has not yet input a value.



Note: You have to implement class NumberNotFoundException.
Download 15.27 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling