How various exceptions are caught with catch

Assignment Help Data Structure & Algorithms
Reference no: EM133124016

Workshop Activity

Given below is the programming exercise from Week 4, Question 5.

Create an application to store the contact details. A Contact should contain first name, last name, email, and phone number (others can be added). The first names of Contacts should be displayed in a listview. When the user selects a name from the listview, the contact details should be displayed in a grid of TextFields or a Table. As the information is modified (a Contact's Data is updated, a new Contact is added or an existing Contact is deleted), the contacts listview should display the updated list of names.

Note: You use the solution available for Week 4 Tutorial Question Five.

Include exception handling for TextFields for entering first name, last name and phone number so that names will not contain any numbers, phone number should not contain any alphabets.

Wrtie a Java program to save the contacts created to binary file named phone.dat using ObjectOutPutStream and read and display the data from the file.

Question 1. If no exceptions are thrown in a try block, where does control proceed to, when the try block completes execution?

Question 2. Write a program that demonstrates how various exceptions are caught with catch (Exception exception) Define classes Exception A (which inherits from class Exception) and ExceptionB (which inherits from class ExceptionA). In your program, create try blocks that throw exceptions of types ExceptionA, ExceptionB, NullPointerException and IOException. All exceptions should be caught with catch blocks specifying type Exception.

Question 3. Write a Java program with a GUI. The program reads data from an existing data file named staffphone.csv and displays all data on the text area properly after the button "Display" is pressed. The data in the file staffphone.csv have the following format
John Pearson, 49308877
Peter London, 49446701
Amy Andersen, 45009923

In addition, the program also displays total number of the phone entry on the text area.

Reference no: EM133124016

Questions Cloud

How type of attack can adversely impact infrastructure : Explain how this type of attack can adversely impact infrastructure. Explain methods organizations can implement to prevent DoS attacks from occurring.
Different layers of network infrastructure : Looking at the different layers of network infrastructure provides many opportunities to recognize vulnerabilities, select and deploy countermeasures,
Describing roots of macro practice in history : Begin by describing the roots of macro practice in the history and development of social work as a profession/discipline.
Appliance warehouse services-application maintenance : Explain your overall approach to analyzing and addressing the needs of the new Appliance Warehouse Service Department.
How various exceptions are caught with catch : Write a Java program with a GUI. The program reads data from an existing data file named staffphone.csv and displays all data on the text area properly
Draw a diagram containing the long-run average : Draw a diagram containing the long-run average and marginal cost curves, the demand curve facing the firm, and the marginal revenue curve for a profit maximizai
Determine the optimum cash balance : The daily average disbursement is P40,000. Cost to transfer money into the account average P500 each time. Determine the optimum cash balance
Canadian awards for business excellence : Write a report: The report should include an introduction, body with various headings, a section titled 'conclusions and recommendations'. This last section mus
Explain what is meant by the value web : Explain what is meant by the Value Web and what effect it can have in the modern business environment today.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Process of insertion into a heap-implemented priority queue

Explain the process of insertion into a heap-implemented priority queue, and informally explain its complexity and the process of removal from a heap-implemented priority queue, and informally explain its complexity.

  Exploring oop and its data structures

Exploring OOP and its Data Structures

  Modify the array-based linear search algorithm

Modify the array-based linear search algorithm to make it more efficient for ordered lists.

  Use either the bubble sort or the selection sort algorithms

use either the Bubble Sort or the Selection Sort algorithms

  Website creation

Construct a basic, generic structure of a web site. Name it something generic etc. Demonstrate some basic layout of the content of the pages.

  Implement a heap-based priority queue

Implement a heap-based priority queue that supports the following additional operation in linear time: replaceComparator(c): Replace current comparator with c.

  Your algorithm will keep track of a customers purchases at

your algorithm will keep track of a customers purchases at the local fireworks stand. customers will not know exactly

  Creating a unix shell script

Design a Unix shell script that searches for a text document with most occurrences of a given keyword. For instance, if I would like to search for a script with most usages of if statement,

  Append a flowchart based on the algorithm

Append a flowchart based on the algorithm for the revised program needs. Add this to the revised program flowchart from the Week One Individual Assignment.

  Explain the concept of dns

Assume your job is to support desktop computers in a small corporation of 32 workers. A consulting company is setting up a private Web server to be used internally by company workers.

  Write methods that take a reference to binary tree root

Write efficient methods (and give their Big-Oh running times) that take a reference to a binary tree root T and compute-The number of leaves in T.

  Write a program that reads the records in used file

Write a program that reads the records in Used File (described at the end of Chapter 4) and stores them in an array or vector.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd