Program Three Titanic Insurance company insures various types of assets. This program is a prototype for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Program Three Titanic Insurance company insures various types of assets. This program is a prototype for them to demonstrate the ability to work with four types of assets, Automobile, Boat, House, and Jewelry. A true insurance program would be much more complex, but they just want to see a proof of concept. The insurance company wants to be able to load various types of these items into a Java program and then print some information. They want to be able to put all of their insured assets into an array and then to sort them and print them in various ways. In particular, they would like to see the items sorted by: A. Type B. Name C. Value D. Insurance Cost There should be a menu that allows the user to print the items sorted each of these ways as well as an option to quit. The list should show each of the four values mentioned above. The menu should also provide a means to quit the program. (The menu has actually been created for you; I'm certain that after CPT 167 you know how to do menus.) Implementation details Appropriate classes for the four types of assets have already been created for you. You should not modify these classes. There is also the beginning of the Insurance Manager class. The menu is there, but the functionality is missing or incomplete. There is other code completed as well, but a lot is left up to you. Insurable interface Start by completing the (currently empty) Insurable interface. The interface must extend Comparable . It must have the following methods: String getName() -- returns the name of the object String getType() -- returns the type of the object; this just means 'Automobile', 'Boat', etc. double getValue() -- returns the value of the object double getRate() -- returns the insurance rate for this object Get the interface completed first. If you start trying to 'fix' the program before correctly defining the Insurable interface, you'll just get mired down in unhelpful Eclipse suggestions. Again, the Insurable interface must extend Comparable . This is important. Insurable implementations For each of the classes mentioned above, there is an associated class, e.g. InsuredAutomobile. These classes must extend the appropriate base class (e.g. Automobile) and implement the Insurable interface. Let Eclipse help you as you implement the interface. All of these have an existing getName method. The Insured House class has been further completed, though once the Insurable interface is completed, you will need to do some more work. These classes should not need any new methods other than those required by the interface, though if you find the need to supply some private method to make the code cleaner, feel free to do so. Get these classes done next. Do not attempt to work on the Agency class until you have fixed the 'Insured' classes. The Agency class There is an Agency class that has a list of Insurable objects, ArrayList , that is to be loaded when the constructor is called. The constructor must accept the filename of the records to be loaded. This class will need the following: loadItems(string):void - loads the list of Insurables from the provided filename. This code for this method has been started but works only for House assets. It must be modified to load others. getItemList(): List - this method returns the (unmodifiable) list of items read from the file. This code is complete. Note that the list returned cannot be sorted, you will need to create a new list from the one returned so that you can sort it. CostComparer - a static nested class that compares two Insurable objects based on cost. It must implement the Comparator interface. See below for how it is to be used. This class also has four constants that hold the rates of each type of insured asset. These values are to be used when a new 'Insured' object is created. The Insurance Manager class There is be an Insurance Manager class where the main method resides. All sorting must all be done in the Insurance Manager, though not necessarily the main method. How the sorting is done must follow these directions precisely. This assignment is not an exercise in sorting, but in using interfaces and lambda expressions. Just because the list is sorted in the required order does not mean that credit will be awarded; again, the sorting methods must follow the instructions. As noted above, the menu must allow for four types of sorts: Name - The natural sort order, that is, the compare To method required when implementing the Insurable interface must be sorted by name. This means that Collections.sort will be called only with the list, nothing else. Each of your classes will be forced to implement the compare To method when the class implements the Insurable interface. Insurance Cost-Sorting by insurance cost must use a nested class in the Agency class. It must implement the Comparator interface. You will need to create a new one of these when you do your sorting. Create a new one of these in the getCostComparer method. Type - Sorting by type must be done using a lambda expression. Value - Sorting by value must use an anonymous class. The anonymous class must be created somewhere in your Insurance Manager class. The input file There will be four types of records in the file, one for each type of asset to be insured. The records start with the first letter of the asset type, (A)utomobile, (B)oat, (H)ouse, and (J)ewelry. Each line will have different comma separated fields, depending on the record type. Here is the order of each field, the Java type, and an example: Automobile: Type char A Boat: Type char B House: Type char H Jewelry: Type char J Make String Pontiac Builder String Hobie Cat Style String Bungalow Article String Bracelet Model String Vibe Length int 16 Price Per SqFt SqFt double int 163.0 1445 Too few fields on a line Invalid numeric values primary material String diamond Invalid type characters Too many fields on a line Year int 2007 Year int 2019 Bedrooms Int 3 secondary material String silver Value double 1800 Value double 7800 Baths int 3 value Other Notes: Notice that the Agency and the other classes are in a package that ends with 'model'. These are classes that know how to do 'Agency' stuff. They should not know how to do any user stuff. This means that they should never communicate with the user, for example, using System.out. Any communication with the user must be in the Insurance Manager class, which is our user interface. double 9100 For a starting grade of 'B': (no 'C' on this one) Complete the code such that it meets the above requirements. You will need to create an interface, implement the interface in various classes, etc. Note that for a couple of classes, the getName method has been completed for you. You should not change this code. This assignment is mostly about using interfaces; in one case, an interface that you develop (Insurable), in other cases, interfaces provided by Java packages, e.g. Comparable. It is also about understanding how to use classes and lambda expressions to implement the behavior of those interfaces. For a starting grade of 'A': Add exception handling to the reading of the file. You must catch these types of errors at a minimum: The first two errors must be caught using exceptions. You may catch the second two by throwing exceptions or by printing an appropriate message w/o throwing an exception. It is up to you. There are a few specific requirements: Reading of the file must NOT stop when an error occurs When an error is found, the line number of the error and the line itself must be printed, e.g. Error on line 12 - 'z' is not an appropriate type: Z, Belt, Brass, Silver, 2000 Each type of error must contain an error specific output; don't simply say invalid input on line 12. Tell what the error is. Output: Given the test file supplied with the program, sorting by Name should produce the following: Type Name Value Cost Boat 16' 2019 Hobie 7800.00 546.00 Boat 19 2010 Prindle 3900.00 273.00 Automobile 1957 Chevrolet Bel Air Automobile 1967 Chevrolet Covair House 2/2/0 Bungalow (1445 sqft) Automobile 2007 Pontiac Vibe Automobile 2019 Nisan Rogue Automobile 2020 Ford Mustang House House House 3/2/0 Bungalow (1445 sqft) 3/2/0 Ranch (1345 sqft) 3/3/0 Bungalow (1445 sqft) 3/3/0 Cottage (1345 sqft) 30' 1975 Catalina House Boat Boat 32' 1990 Hunter House 4/2/0 Ranch (1445 sqft) House 4/4/0 TwoStory (2045 sqft) Boat 42 1995 Pearson House 5/2/0 Split Level (2245 sqft) Jewelry diamond Bracelet Jewelry diamond Necklace Jewelry gold Nose Ring gold Watch Jewelry Jewelry Jewelry gold Wedding Ring plastic Cassio Watch 31000.00 1395.00 18900.00 850.50 258355.00 1937.66 2300.00 103.50 19200.00 864.00 41900.00 1885.50 1986.56 264875.00 248575.00 269765.00 253465.00 1864.31 2023.24 1900.99 696.50 9950.00 50000.00 3500.00 271395.00 2035.46 378975.00 2842.31 38000.00 2660.00 408315.00 3062.36 9100.00 45.50 19000.00 95.00 1200.00 6.00 29000.00 1100.00 29.00 145.00 5.50 0.15 A note on a cleaner implementation: As OOP concepts have become popular, professional programmers now tend to favor composition rather than inheritance. That is, the 'Insured' classes would not extend the associated class but would instead have the associated class as one of its members. That is, InsuredAutomobile would not extend Automobile. Instead, the InsuredAutomobile class would have as one of its members an Automobile. Any information that was needed from the Automobile would come from that object. If this paragraph makes sense to you and you would like to use composition rather Program Three Titanic Insurance company insures various types of assets. This program is a prototype for them to demonstrate the ability to work with four types of assets, Automobile, Boat, House, and Jewelry. A true insurance program would be much more complex, but they just want to see a proof of concept. The insurance company wants to be able to load various types of these items into a Java program and then print some information. They want to be able to put all of their insured assets into an array and then to sort them and print them in various ways. In particular, they would like to see the items sorted by: A. Type B. Name C. Value D. Insurance Cost There should be a menu that allows the user to print the items sorted each of these ways as well as an option to quit. The list should show each of the four values mentioned above. The menu should also provide a means to quit the program. (The menu has actually been created for you; I'm certain that after CPT 167 you know how to do menus.) Implementation details Appropriate classes for the four types of assets have already been created for you. You should not modify these classes. There is also the beginning of the Insurance Manager class. The menu is there, but the functionality is missing or incomplete. There is other code completed as well, but a lot is left up to you. Insurable interface Start by completing the (currently empty) Insurable interface. The interface must extend Comparable . It must have the following methods: String getName() -- returns the name of the object String getType() -- returns the type of the object; this just means 'Automobile', 'Boat', etc. double getValue() -- returns the value of the object double getRate() -- returns the insurance rate for this object Get the interface completed first. If you start trying to 'fix' the program before correctly defining the Insurable interface, you'll just get mired down in unhelpful Eclipse suggestions. Again, the Insurable interface must extend Comparable . This is important. Insurable implementations For each of the classes mentioned above, there is an associated class, e.g. InsuredAutomobile. These classes must extend the appropriate base class (e.g. Automobile) and implement the Insurable interface. Let Eclipse help you as you implement the interface. All of these have an existing getName method. The Insured House class has been further completed, though once the Insurable interface is completed, you will need to do some more work. These classes should not need any new methods other than those Program Three Titanic Insurance company insures various types of assets. This program is a prototype for them to demonstrate the ability to work with four types of assets, Automobile, Boat, House, and Jewelry. A true insurance program would be much more complex, but they just want to see a proof of concept. The insurance company wants to be able to load various types of these items into a Java program and then print some information. They want to be able to put all of their insured assets into an array and then to sort them and print them in various ways. In particular, they would like to see the items sorted by: A. Type B. Name C. Value D. Insurance Cost There should be a menu that allows the user to print the items sorted each of these ways as well as an option to quit. The list should show each of the four values mentioned above. The menu should also provide a means to quit the program. (The menu has actually been created for you; I'm certain that after CPT 167 you know how to do menus.) Implementation details Appropriate classes for the four types of assets have already been created for you. You should not modify these classes. There is also the beginning of the Insurance Manager class. The menu is there, but the functionality is missing or incomplete. There is other code completed as well, but a lot is left up to you. Insurable interface Start by completing the (currently empty) Insurable interface. The interface must extend Comparable . It must have the following methods: String getName() -- returns the name of the object String getType() -- returns the type of the object; this just means 'Automobile', 'Boat', etc. double getValue() -- returns the value of the object double getRate() -- returns the insurance rate for this object Get the interface completed first. If you start trying to 'fix' the program before correctly defining the Insurable interface, you'll just get mired down in unhelpful Eclipse suggestions. Again, the Insurable interface must extend Comparable . This is important. Insurable implementations For each of the classes mentioned above, there is an associated class, e.g. InsuredAutomobile. These classes must extend the appropriate base class (e.g. Automobile) and implement the Insurable interface. Let Eclipse help you as you implement the interface. All of these have an existing getName method. The Insured House class has been further completed, though once the Insurable interface is completed, you will need to do some more work. These classes should not need any new methods other than those Program Three Titanic Insurance company insures various types of assets. This program is a prototype for them to demonstrate the ability to work with four types of assets, Automobile, Boat, House, and Jewelry. A true insurance program would be much more complex, but they just want to see a proof of concept. The insurance company wants to be able to load various types of these items into a Java program and then print some information. They want to be able to put all of their insured assets into an array and then to sort them and print them in various ways. In particular, they would like to see the items sorted by: A. Type B. Name C. Value D. Insurance Cost There should be a menu that allows the user to print the items sorted each of these ways as well as an option to quit. The list should show each of the four values mentioned above. The menu should also provide a means to quit the program. (The menu has actually been created for you; I'm certain that after CPT 167 you know how to do menus.) Implementation details Appropriate classes for the four types of assets have already been created for you. You should not modify these classes. There is also the beginning of the Insurance Manager class. The menu is there, but the functionality is missing or incomplete. There is other code completed as well, but a lot is left up to you. Insurable interface Start by completing the (currently empty) Insurable interface. The interface must extend Comparable . It must have the following methods: String getName() -- returns the name of the object String getType() -- returns the type of the object; this just means 'Automobile', 'Boat', etc. double getValue() -- returns the value of the object double getRate() -- returns the insurance rate for this object Get the interface completed first. If you start trying to 'fix' the program before correctly defining the Insurable interface, you'll just get mired down in unhelpful Eclipse suggestions. Again, the Insurable interface must extend Comparable . This is important. Insurable implementations For each of the classes mentioned above, there is an associated class, e.g. InsuredAutomobile. These classes must extend the appropriate base class (e.g. Automobile) and implement the Insurable interface. Let Eclipse help you as you implement the interface. All of these have an existing getName method. The Insured House class has been further completed, though once the Insurable interface is completed, you will need to do some more work. These classes should not need any new methods other than those required by the interface, though if you find the need to supply some private method to make the code cleaner, feel free to do so. Get these classes done next. Do not attempt to work on the Agency class until you have fixed the 'Insured' classes. The Agency class There is an Agency class that has a list of Insurable objects, ArrayList , that is to be loaded when the constructor is called. The constructor must accept the filename of the records to be loaded. This class will need the following: loadItems(string):void - loads the list of Insurables from the provided filename. This code for this method has been started but works only for House assets. It must be modified to load others. getItemList(): List - this method returns the (unmodifiable) list of items read from the file. This code is complete. Note that the list returned cannot be sorted, you will need to create a new list from the one returned so that you can sort it. CostComparer - a static nested class that compares two Insurable objects based on cost. It must implement the Comparator interface. See below for how it is to be used. This class also has four constants that hold the rates of each type of insured asset. These values are to be used when a new 'Insured' object is created. The Insurance Manager class There is be an Insurance Manager class where the main method resides. All sorting must all be done in the Insurance Manager, though not necessarily the main method. How the sorting is done must follow these directions precisely. This assignment is not an exercise in sorting, but in using interfaces and lambda expressions. Just because the list is sorted in the required order does not mean that credit will be awarded; again, the sorting methods must follow the instructions. As noted above, the menu must allow for four types of sorts: Name - The natural sort order, that is, the compare To method required when implementing the Insurable interface must be sorted by name. This means that Collections.sort will be called only with the list, nothing else. Each of your classes will be forced to implement the compare To method when the class implements the Insurable interface. Insurance Cost-Sorting by insurance cost must use a nested class in the Agency class. It must implement the Comparator interface. You will need to create a new one of these when you do your sorting. Create a new one of these in the getCostComparer method. Type - Sorting by type must be done using a lambda expression. Value - Sorting by value must use an anonymous class. The anonymous class must be created somewhere in your Insurance Manager class. The input file There will be four types of records in the file, one for each type of asset to be insured. The records start with the first letter of the asset type, (A)utomobile, (B)oat, (H)ouse, and (J)ewelry. Each line will have different comma separated fields, depending on the record type. Here is the order of each field, the Java type, and an example: required by the interface, though if you find the need to supply some private method to make the code cleaner, feel free to do so. Get these classes done next. Do not attempt to work on the Agency class until you have fixed the 'Insured' classes. The Agency class There is an Agency class that has a list of Insurable objects, ArrayList , that is to be loaded when the constructor is called. The constructor must accept the filename of the records to be loaded. This class will need the following: loadItems(string):void - loads the list of Insurables from the provided filename. This code for this method has been started but works only for House assets. It must be modified to load others. getItemList(): List - this method returns the (unmodifiable) list of items read from the file. This code is complete. Note that the list returned cannot be sorted, you will need to create a new list from the one returned so that you can sort it. CostComparer - a static nested class that compares two Insurable objects based on cost. It must implement the Comparator interface. See below for how it is to be used. This class also has four constants that hold the rates of each type of insured asset. These values are to be used when a new 'Insured' object is created. The Insurance Manager class There is be an Insurance Manager class where the main method resides. All sorting must all be done in the Insurance Manager, though not necessarily the main method. How the sorting is done must follow these directions precisely. This assignment is not an exercise in sorting, but in using interfaces and lambda expressions. Just because the list is sorted in the required order does not mean that credit will be awarded; again, the sorting methods must follow the instructions. As noted above, the menu must allow for four types of sorts: Name - The natural sort order, that is, the compare To method required when implementing the Insurable interface must be sorted by name. This means that Collections.sort will be called only with the list, nothing else. Each of your classes will be forced to implement the compare To method when the class implements the Insurable interface. Insurance Cost-Sorting by insurance cost must use a nested class in the Agency class. It must implement the Comparator interface. You will need to create a new one of these when you do your sorting. Create a new one of these in the getCostComparer method. Type - Sorting by type must be done using a lambda expression. Value - Sorting by value must use an anonymous class. The anonymous class must be created somewhere in your Insurance Manager class. The input file There will be four types of records in the file, one for each type of asset to be insured. The records start with the first letter of the asset type, (A)utomobile, (B)oat, (H)ouse, and (J)ewelry. Each line will have different comma separated fields, depending on the record type. Here is the order of each field, the Java type, and an example: required by the interface, though if you find the need to supply some private method to make the code cleaner, feel free to do so. Get these classes done next. Do not attempt to work on the Agency class until you have fixed the 'Insured' classes. The Agency class There is an Agency class that has a list of Insurable objects, ArrayList , that is to be loaded when the constructor is called. The constructor must accept the filename of the records to be loaded. This class will need the following: loadItems(string):void - loads the list of Insurables from the provided filename. This code for this method has been started but works only for House assets. It must be modified to load others. getItemList(): List - this method returns the (unmodifiable) list of items read from the file. This code is complete. Note that the list returned cannot be sorted, you will need to create a new list from the one returned so that you can sort it. CostComparer - a static nested class that compares two Insurable objects based on cost. It must implement the Comparator interface. See below for how it is to be used. This class also has four constants that hold the rates of each type of insured asset. These values are to be used when a new 'Insured' object is created. The Insurance Manager class There is be an Insurance Manager class where the main method resides. All sorting must all be done in the Insurance Manager, though not necessarily the main method. How the sorting is done must follow these directions precisely. This assignment is not an exercise in sorting, but in using interfaces and lambda expressions. Just because the list is sorted in the required order does not mean that credit will be awarded; again, the sorting methods must follow the instructions. As noted above, the menu must allow for four types of sorts: Name - The natural sort order, that is, the compare To method required when implementing the Insurable interface must be sorted by name. This means that Collections.sort will be called only with the list, nothing else. Each of your classes will be forced to implement the compare To method when the class implements the Insurable interface. Insurance Cost-Sorting by insurance cost must use a nested class in the Agency class. It must implement the Comparator interface. You will need to create a new one of these when you do your sorting. Create a new one of these in the getCostComparer method. Type - Sorting by type must be done using a lambda expression. Value - Sorting by value must use an anonymous class. The anonymous class must be created somewhere in your Insurance Manager class. The input file There will be four types of records in the file, one for each type of asset to be insured. The records start with the first letter of the asset type, (A)utomobile, (B)oat, (H)ouse, and (J)ewelry. Each line will have different comma separated fields, depending on the record type. Here is the order of each field, the Java type, and an example: Automobile: Type char A Boat: Type char B House: Type char H Jewelry: Type char J Make String Pontiac Builder String Hobie Cat Style String Bungalow Article String Bracelet Model String Vibe Length int 16 Price Per SqFt SqFt double int 163.0 1445 Too few fields on a line Invalid numeric values primary material String diamond Invalid type characters Too many fields on a line Year int 2007 Year int 2019 Bedrooms Int 3 secondary material String silver Value double 1800 Value double 7800 Baths int 3 value Other Notes: Notice that the Agency and the other classes are in a package that ends with 'model'. These are classes that know how to do 'Agency' stuff. They should not know how to do any user stuff. This means that they should never communicate with the user, for example, using System.out. Any communication with the user must be in the Insurance Manager class, which is our user interface. double 9100 For a starting grade of 'B': (no 'C' on this one) Complete the code such that it meets the above requirements. You will need to create an interface, implement the interface in various classes, etc. Note that for a couple of classes, the getName method has been completed for you. You should not change this code. This assignment is mostly about using interfaces; in one case, an interface that you develop (Insurable), in other cases, interfaces provided by Java packages, e.g. Comparable. It is also about understanding how to use classes and lambda expressions to implement the behavior of those interfaces. For a starting grade of 'A': Add exception handling to the reading of the file. You must catch these types of errors at a minimum: Automobile: Type char A Boat: Type char B House: Type char H Jewelry: Type char J Make String Pontiac Builder String Hobie Cat Style String Bungalow Article String Bracelet Model String Vibe Length int 16 Price Per SqFt SqFt double int 163.0 1445 Too few fields on a line Invalid numeric values primary material String diamond Invalid type characters Too many fields on a line Year int 2007 Year int 2019 Bedrooms Int 3 secondary material String silver Value double 1800 Value double 7800 Baths int 3 value Other Notes: Notice that the Agency and the other classes are in a package that ends with 'model'. These are classes that know how to do 'Agency' stuff. They should not know how to do any user stuff. This means that they should never communicate with the user, for example, using System.out. Any communication with the user must be in the Insurance Manager class, which is our user interface. double 9100 For a starting grade of 'B': (no 'C' on this one) Complete the code such that it meets the above requirements. You will need to create an interface, implement the interface in various classes, etc. Note that for a couple of classes, the getName method has been completed for you. You should not change this code. This assignment is mostly about using interfaces; in one case, an interface that you develop (Insurable), in other cases, interfaces provided by Java packages, e.g. Comparable. It is also about understanding how to use classes and lambda expressions to implement the behavior of those interfaces. For a starting grade of 'A': Add exception handling to the reading of the file. You must catch these types of errors at a minimum: Automobile: Type char A Boat: Type char B House: Type char H Jewelry: Type char J Make String Pontiac Builder String Hobie Cat Style String Bungalow Article String Bracelet Model String Vibe Length int 16 Price Per SqFt SqFt double int 163.0 1445 Too few fields on a line Invalid numeric values primary material String diamond Invalid type characters Too many fields on a line Year int 2007 Year int 2019 Bedrooms Int 3 secondary material String silver Value double 1800 Value double 7800 Baths int 3 value Other Notes: Notice that the Agency and the other classes are in a package that ends with 'model'. These are classes that know how to do 'Agency' stuff. They should not know how to do any user stuff. This means that they should never communicate with the user, for example, using System.out. Any communication with the user must be in the Insurance Manager class, which is our user interface. double 9100 For a starting grade of 'B': (no 'C' on this one) Complete the code such that it meets the above requirements. You will need to create an interface, implement the interface in various classes, etc. Note that for a couple of classes, the getName method has been completed for you. You should not change this code. This assignment is mostly about using interfaces; in one case, an interface that you develop (Insurable), in other cases, interfaces provided by Java packages, e.g. Comparable. It is also about understanding how to use classes and lambda expressions to implement the behavior of those interfaces. For a starting grade of 'A': Add exception handling to the reading of the file. You must catch these types of errors at a minimum: The first two errors must be caught using exceptions. You may catch the second two by throwing exceptions or by printing an appropriate message w/o throwing an exception. It is up to you. There are a few specific requirements: Reading of the file must NOT stop when an error occurs When an error is found, the line number of the error and the line itself must be printed, e.g. Error on line 12 - 'z' is not an appropriate type: Z, Belt, Brass, Silver, 2000 Each type of error must contain an error specific output; don't simply say invalid input on line 12. Tell what the error is. Output: Given the test file supplied with the program, sorting by Name should produce the following: Type Name Value Cost Boat 16' 2019 Hobie 7800.00 546.00 Boat 19 2010 Prindle 3900.00 273.00 Automobile 1957 Chevrolet Bel Air Automobile 1967 Chevrolet Covair House 2/2/0 Bungalow (1445 sqft) Automobile 2007 Pontiac Vibe Automobile 2019 Nisan Rogue Automobile 2020 Ford Mustang House House House 3/2/0 Bungalow (1445 sqft) 3/2/0 Ranch (1345 sqft) 3/3/0 Bungalow (1445 sqft) 3/3/0 Cottage (1345 sqft) 30' 1975 Catalina House Boat Boat 32' 1990 Hunter House 4/2/0 Ranch (1445 sqft) House 4/4/0 TwoStory (2045 sqft) Boat 42 1995 Pearson House 5/2/0 Split Level (2245 sqft) Jewelry diamond Bracelet Jewelry diamond Necklace Jewelry gold Nose Ring gold Watch Jewelry Jewelry Jewelry gold Wedding Ring plastic Cassio Watch 31000.00 1395.00 18900.00 850.50 258355.00 1937.66 2300.00 103.50 19200.00 864.00 41900.00 1885.50 1986.56 264875.00 248575.00 269765.00 253465.00 1864.31 2023.24 1900.99 696.50 9950.00 50000.00 3500.00 271395.00 2035.46 378975.00 2842.31 38000.00 2660.00 408315.00 3062.36 9100.00 45.50 19000.00 95.00 1200.00 6.00 29000.00 1100.00 29.00 145.00 5.50 0.15 A note on a cleaner implementation: As OOP concepts have become popular, professional programmers now tend to favor composition rather than inheritance. That is, the 'Insured' classes would not extend the associated class but would instead have the associated class as one of its members. That is, InsuredAutomobile would not extend Automobile. Instead, the InsuredAutomobile class would have as one of its members an Automobile. Any information that was needed from the Automobile would come from that object. If this paragraph makes sense to you and you would like to use composition rather The first two errors must be caught using exceptions. You may catch the second two by throwing exceptions or by printing an appropriate message w/o throwing an exception. It is up to you. There are a few specific requirements: Reading of the file must NOT stop when an error occurs When an error is found, the line number of the error and the line itself must be printed, e.g. Error on line 12 - 'z' is not an appropriate type: Z, Belt, Brass, Silver, 2000 Each type of error must contain an error specific output; don't simply say invalid input on line 12. Tell what the error is. Output: Given the test file supplied with the program, sorting by Name should produce the following: Type Name Value Cost Boat 16' 2019 Hobie 7800.00 546.00 Boat 19 2010 Prindle 3900.00 273.00 Automobile 1957 Chevrolet Bel Air Automobile 1967 Chevrolet Covair House 2/2/0 Bungalow (1445 sqft) Automobile 2007 Pontiac Vibe Automobile 2019 Nisan Rogue Automobile 2020 Ford Mustang House House House 3/2/0 Bungalow (1445 sqft) 3/2/0 Ranch (1345 sqft) 3/3/0 Bungalow (1445 sqft) 3/3/0 Cottage (1345 sqft) 30' 1975 Catalina House Boat Boat 32' 1990 Hunter House 4/2/0 Ranch (1445 sqft) House 4/4/0 TwoStory (2045 sqft) Boat 42 1995 Pearson House 5/2/0 Split Level (2245 sqft) Jewelry diamond Bracelet Jewelry diamond Necklace Jewelry gold Nose Ring gold Watch Jewelry Jewelry Jewelry gold Wedding Ring plastic Cassio Watch 31000.00 1395.00 18900.00 850.50 258355.00 1937.66 2300.00 103.50 19200.00 864.00 41900.00 1885.50 1986.56 264875.00 248575.00 269765.00 253465.00 1864.31 2023.24 1900.99 696.50 9950.00 50000.00 3500.00 271395.00 2035.46 378975.00 2842.31 38000.00 2660.00 408315.00 3062.36 9100.00 45.50 19000.00 95.00 1200.00 6.00 29000.00 1100.00 29.00 145.00 5.50 0.15 A note on a cleaner implementation: As OOP concepts have become popular, professional programmers now tend to favor composition rather than inheritance. That is, the 'Insured' classes would not extend the associated class but would instead have the associated class as one of its members. That is, InsuredAutomobile would not extend Automobile. Instead, the InsuredAutomobile class would have as one of its members an Automobile. Any information that was needed from the Automobile would come from that object. If this paragraph makes sense to you and you would like to use composition rather The first two errors must be caught using exceptions. You may catch the second two by throwing exceptions or by printing an appropriate message w/o throwing an exception. It is up to you. There are a few specific requirements: Reading of the file must NOT stop when an error occurs When an error is found, the line number of the error and the line itself must be printed, e.g. Error on line 12 - 'z' is not an appropriate type: Z, Belt, Brass, Silver, 2000 Each type of error must contain an error specific output; don't simply say invalid input on line 12. Tell what the error is. Output: Given the test file supplied with the program, sorting by Name should produce the following: Type Name Value Cost Boat 16' 2019 Hobie 7800.00 546.00 Boat 19 2010 Prindle 3900.00 273.00 Automobile 1957 Chevrolet Bel Air Automobile 1967 Chevrolet Covair House 2/2/0 Bungalow (1445 sqft) Automobile 2007 Pontiac Vibe Automobile 2019 Nisan Rogue Automobile 2020 Ford Mustang House House House 3/2/0 Bungalow (1445 sqft) 3/2/0 Ranch (1345 sqft) 3/3/0 Bungalow (1445 sqft) 3/3/0 Cottage (1345 sqft) 30' 1975 Catalina House Boat Boat 32' 1990 Hunter House 4/2/0 Ranch (1445 sqft) House 4/4/0 TwoStory (2045 sqft) Boat 42 1995 Pearson House 5/2/0 Split Level (2245 sqft) Jewelry diamond Bracelet Jewelry diamond Necklace Jewelry gold Nose Ring gold Watch Jewelry Jewelry Jewelry gold Wedding Ring plastic Cassio Watch 31000.00 1395.00 18900.00 850.50 258355.00 1937.66 2300.00 103.50 19200.00 864.00 41900.00 1885.50 1986.56 264875.00 248575.00 269765.00 253465.00 1864.31 2023.24 1900.99 696.50 9950.00 50000.00 3500.00 271395.00 2035.46 378975.00 2842.31 38000.00 2660.00 408315.00 3062.36 9100.00 45.50 19000.00 95.00 1200.00 6.00 29000.00 1100.00 29.00 145.00 5.50 0.15 A note on a cleaner implementation: As OOP concepts have become popular, professional programmers now tend to favor composition rather than inheritance. That is, the 'Insured' classes would not extend the associated class but would instead have the associated class as one of its members. That is, InsuredAutomobile would not extend Automobile. Instead, the InsuredAutomobile class would have as one of its members an Automobile. Any information that was needed from the Automobile would come from that object. If this paragraph makes sense to you and you would like to use composition rather
Expert Answer:
Related Book For
Financial Management Theory & Practice
ISBN: 9780324652178
12th Edition
Authors: Eugene BrighamMichael Ehrhardt
Posted Date:
Students also viewed these programming questions
-
What type of business is S. G. Cowen? How is this firm different from the other financial firms? How systems and operations of financial firms are different from other types of businesses - say...
-
Single PlantwideandMultiple Production Department Factory Overhead Rate Methodsand Product Cost Distortion The management of Nova Industries Inc. manufactures gasoline and diesel engines through two...
-
During fiscal year 2016, Ellis Bakery reported a net income of $130.7 million. Ellis Bakery received $1.4 million from the sale of other businesses. Ellis Bakery made capital expenditures of $10.6...
-
1.Max finished his PhD and graduated from university in December 2018. He entered the workforce on January 1, 2019 with a gross salary of $85,000 plus an immediate $5,000 signing bonus when he...
-
What the differences are between a till tap, a keeper, and a bank levy?
-
Jeremy Zabel operates his own catering service. Summary financial data for February are presented in equation form as follows. Each line designated by a number indicates the effect of a transaction...
-
Commodity Super Cycle Are we in another commodity super cycle (or is it just pandemic generated bottlenecks?) Timber prices up 300-400% Housing boom or what? Copper prices at their highest prce ever....
-
The data file agstrat.dat also contains information on other variables. For each of the following quantities, plot the data, and estimate the population mean for that variable along with its standard...
-
Complete second half and show excel formulas Input Trek, Inc. Income Statement for 2021 Sales COGS Other expenses Depreciation EBIT Interest Taxable income Taxes (21%) Net income Dividends Add to...
-
A sphere of copper has a radius of 8.00cmand is compressed uniformly by a force of 6.0010 8 N. The bulk modulus for copper is14010 9 N/m 2 . Calculate the sphere's change in volume V after...
-
A gallon of dishwashing liquid was priced with a markup of $1.95. If this is 64% markup based on selling price, how much is the cost of the dishwashing liquid?
-
Determine the purchase price at the indicated time before maturity of the following bond redeemed at par shown in the table below. Time Before Maturity 7 years Par Value $4,000 Bond Rate Payable...
-
Th-232 has atomic mass of 232.038055 u. What is the binding energy per nucleon for this nuclide? The mass of a neutron is 1.0087 amu, the mass of a proton is 1.0073 amu and the mass of an electron is...
-
What are the strategic imperatives driving the evolution of organizational structures in the era of digital transformation, and how do they reconcile traditional hierarchies with the demands for...
-
1. In the cloning procedure we used in the lab, it is possible, albeit unlikely, for multiple inserts to form a concatamer and be cloned into a single expression vector. If three egfp inserts were...
-
In your readings, there were many examples given for nurturing close family relationships in this ever-evolving technological society we live in Based upon your readings and research describe three...
-
From the standpoint of the borrower, is long-term or short-term credit riskier? Explain. Would it ever make sense to borrow on a short-term basis if short-term rates were above long-term rates?
-
Start with the partial model in the file Ch15 P12 Build a Model.xls on the textbook's Web site. Reacher Technology has consulted with investment bankers and determined the interest rate it would pay...
-
The balance sheets of Hutter Amalgamated are shown below. If the 12/31/2004 value of operations is $756 million, what is the 12/31/2004 value of equity? Balance Sheets, December 31, 2004 (Millions of...
-
Describe American styles of nonverbal communication. Are there different styles of nonverbal communication in different areas of the United States?
-
Discuss the relationship between language and culture.
-
In the 1890 s, L. L. Zamenhof believed that different language was a key source of strife between people. He created Esperanto, which he hoped would be a universal language, to foster peace and...
Study smarter with the SolutionInn App