Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment

Program #1

Write an application named UseInsurance that uses an abstract Insurance class and Health and Life subclasses to display different types of insurance policies and the cost per month. The Insurance class contains a String representing the type of insurance and a double that holds the monthly price. The Insurance class constructor requires a String argument indicating the type of insurance, but the Life and Health class constructors require no arguments. The Insurance class contains a get method for each field; it also contains two abstract methods named setCost() and display(). The Life class setCost() method sets the monthly fee to $36, and the Heal th class sets the monthly fee to $196. Write an application named useinsurance that prompts the user for the type of insurance to be displayed, and then create the appropriate object. Save the files as Life.java, Health.java, Insurance.java, and Uselnsurance.java.

Program # 2

Create an abstract class called Student. The Student class includes a name and a Boolean value representing full-time status. Include an abstract method to determine the tuition, with hill-time students paying a flat fee of $2,000 and part-time students paying $200 per credit hour. Create two subclasses called FullTime and PartTime. Create an application that demonstrates how to create objects of both subclasses. Save the files as Student.java, FuilTimejava, PartTime.java, and UseStudentjava.

Program # 3

Write an application that prompts the user to enter a number to use as an array size, and then attempt to declare an array using the entered size. If the array is created successfully, display an appropriate message. Java generates a NegativeArraySizeException if you attempt to create an array with a negative size, and it creates a NumberFonnatException if you attempt to create an array using a nonnumeric value for the size. Use a catch block that executes if the array size is nonnumeric or negative, displaying a message that indicates the array was not created. Save the file as NegativeArray.java.

Program # 4

Write an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the user to enter a numeric test score for the student. Create a ScoreExcepti on class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreExcepti on, and then display an appropriate message. In addition, store a 0 for the student's score. At the end of the application, display all the student IDs and scores. Save the files as ScoreException.java and TestScore.java.

Program # 5

Create a file that contains your favorite movie quote. Use a text editor such as Notepad and save the file as quote.txt. Copy the file contents and paste them into a word-processing program such as Word. Save the file as quote.docx. Write an application that displays the sizes of the two files, as well as the ratio of the two file sizes to each other. Save the file as FileStatistics2.java.

Program # 6

a. Create a program that accepts a series of employee ID numbers, first names, and last names from the keyboard and saves the data to a file. Save the program as WriteEmployeeList.java. When you execute the program, be sure to enter multiple records that have the same first name because you will search for repeated first names in part d of this exercise.

b. Write an application that reads the file created by the WriteEmployeeList application and displays the records. Save the file as DisplaySavedEmployeeList.java.

c. Write an application that allows you to enter any ID number and displays the first and last name for the record stored in the employee file with the given ID number. Display an appropriate message if the ID number cannot be found in the input file. Save the file as DisplaySelectedIDNumbers.java.

d. Write an application that allows you to enter any first name and displays all the ID numbers and last names for any records stored in the employee file with the given first name. Display an appropriate message if the first name cannot be found in the input file. Save the file as DisplaySelectedFirstNames.java.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92667878

Have any Question?


Related Questions in Computer Engineering

Representing problems as graphs i have 10 and i plan to

Representing Problems as Graphs I have $10, and I plan to spend some or all of my money on three types of candy, which I will buy one piece at a time: chocolate bars cost $3, almond rocca cost $2, and caramel chunks cost ...

In the course of producing its output this firm causes

In the course of producing its output, this firm causes pollution. The government passes a law that requires the firm to stop polluting, and the firm discovers that it can prevent the pollution by hiring 0.2 workers for ...

Question what is stp what is rstp and what methods does

Question : What is STP, what is RSTP, and what methods does Cisco provide to make these two methods work better as networks grow? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

The question is asking how to do it in linuxa scientist ran

The question is asking how to do it in Linux. A scientist ran an experiment that generated data that accumulated in a sequence of files: data1, data2, data3, data4 and data5. He wants to know how many lines of data he ha ...

Question suppose we want to build a b tree that has space

Question : Suppose we want to build a B+ tree that has space for 200,000 data entries in its leaf pages. Each data entry is made up of a key and its corresponding data value. Let us assume the following specifications. E ...

Question please submit your draft apa-formatted research

Question: Please submit your draft APA-formatted research papers through this assignment page. You will have until the end of Week #4 to submit a draft of your paper for consideration as extra credit. This is Part 1 of t ...

One of the basic motivations behind the minimum spanning

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing a spanning network for a set of nodes with minimum  total  cost. Here we explore another type of objective: designing a spann ...

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

Not all context free grammars define regular languages

Not all context free grammars define regular languages. However, the following two DO define regular languages. For each grammar below, (a) describe the corresponding language and (b) draw the corresponding finite state ...

Part 1whats the importance of a documentation plan please

Part 1: What's the importance of a Documentation Plan? Please provide an example of a Documentation Plan that you would use. Part 2: How do you calculate how long a project will take? These questions are for my Introduct ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As