Create a file that contains your favorite movie quote use a


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.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create a file that contains your favorite movie quote use a
Reference No:- TGS02635022

Expected delivery within 24 Hours