Problem: A company is a legal entity formed by a group of individuals to engage in and operate a business enterprise. A company may be organized in various ways for tax and financial liability purposes depending on the corporate law of its jurisdiction. Businesses can be for-profit entities or they can be non-profit organizations that operate to fulfil a charitable mission or further a social cause. You are requested to develop an OOP solution that computes a company and/or business tax payments based on company’s income and business’ profit. Create a NetBeans project named “LabTest_YourId”. Include the following interfaces and classes: - Interface Tax that includes two parameter-less methods: o getEarningAmount: should return a double value. o getTax: also return a double value presenting percentage of tax to be paid. - Class Company: o A company has a name, registration address, income and tax percentage. o Include a constructor that receives a company information as parameters and use it to set the company object data. o The class should implement the Tax interface, as follows: It returns the income as the earning amount. It returns the tax percentage of a company. o Override toString( ) method to describe company object as follow: “company name [ registration address ]” . o No further mutator (set) or accessor (get) methods are requested for this class. - Class Business: o A business object has an owner name, profit, and tax percentage. o Include a constructor that receives a business information as parameters and use it to set a business object. o Class business should implement the Tax interface, as follows: It returns the business profit as the earning amount. It returns the tax percentage to be paid by this business. o Implement get method to retrieve the business’ owner name. o Do not apply mutator methods. Page 2 of 4 - Class TaxDemo: o This is a tester program to test the above classes. It should have below methods: The calculateTax method: that accepts an amount and tax-percent x% and returns x% of the amount. The display static method: to print the output as shown in the sample run below (Figure 2), this method calls calculateTax to obtain tax amount for each Company/ Business object. The main method: - Sample run1: Asks user for input file name. Reads objects of type Company and/or Business from the input file into two separate ArrayLists. Where the line for a company object information starts with “c” or “C” and for a business object starts with “b” or “B”. Any other character means invalid line. See Figure 3 for a sample input file, “dataA.txt”, which is also available on Moodle. Your code should catch and handle FileNotFoundException; see Figure 1. For any invalid line, display an error message “Bad data Error: Invalid Type!” with line number that caused the error. See sample output runs in Figure 2. After reading the whole input file, it calls display method to print the output as shown in Figure2.
Problem: A company is a legal entity formed by a group of individuals to engage in and operate a business enterprise. A company may be organized in various ways for tax and financial liability purposes depending on the corporate law of its jurisdiction. Businesses can be for-profit entities or they can be non-profit organizations that operate to fulfil a charitable mission or further a social cause. You are requested to develop an OOP solution that computes a company and/or business tax payments based on company’s income and business’ profit. Create a NetBeans project named “LabTest_YourId”. Include the following interfaces and classes: - Interface Tax that includes two parameter-less methods: o getEarningAmount: should return a double value. o getTax: also return a double value presenting percentage of tax to be paid. - Class Company: o A company has a name, registration address, income and tax percentage. o Include a constructor that receives a company information as parameters and use it to set the company object data. o The class should implement the Tax interface, as follows: It returns the income as the earning amount. It returns the tax percentage of a company. o Override toString( ) method to describe company object as follow: “company name [ registration address ]” . o No further mutator (set) or accessor (get) methods are requested for this class. - Class Business: o A business object has an owner name, profit, and tax percentage. o Include a constructor that receives a business information as parameters and use it to set a business object. o Class business should implement the Tax interface, as follows: It returns the business profit as the earning amount. It returns the tax percentage to be paid by this business. o Implement get method to retrieve the business’ owner name. o Do not apply mutator methods. Page 2 of 4 - Class TaxDemo: o This is a tester program to test the above classes. It should have below methods: The calculateTax method: that accepts an amount and tax-percent x% and returns x% of the amount. The display static method: to print the output as shown in the sample run below (Figure 2), this method calls calculateTax to obtain tax amount for each Company/ Business object. The main method: - Sample run1: Asks user for input file name. Reads objects of type Company and/or Business from the input file into two separate ArrayLists. Where the line for a company object information starts with “c” or “C” and for a business object starts with “b” or “B”. Any other character means invalid line. See Figure 3 for a sample input file, “dataA.txt”, which is also available on Moodle. Your code should catch and handle FileNotFoundException; see Figure 1. For any invalid line, display an error message “Bad data Error: Invalid Type!” with line number that caused the error. See sample output runs in Figure 2. After reading the whole input file, it calls display method to print the output as shown in Figure2.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Problem:
A company is a legal entity formed by a group of individuals to engage in and operate a business enterprise. A company may be organized in various ways for tax and financial liability purposes depending on the corporate law of its jurisdiction. Businesses can be for-profit entities or they can be non-profit organizations that operate to fulfil a charitable mission or further a social cause.
You are requested to develop an OOP solution that computes a company and/or business tax payments based on company’s income and business’ profit. Create a NetBeans project named “LabTest_YourId”. Include the following interfaces and classes:
- Interface Tax that includes two parameter-less methods:
o getEarningAmount: should return a double value.
o getTax: also return a double value presenting percentage of tax to be paid. - Class Company:
o A company has a name, registration address, income and tax percentage.
o Include a constructor that receives a company information as parameters and use it to set the company object
data.
o The class should implement the Tax interface, as follows:
It returns the income as the earning amount.
It returns the tax percentage of a company.
o Override toString( ) method to describe company object as follow: “company name [ registration address ]” . o No further mutator (set) or accessor (get) methods are requested for this class.
- Class Business:
o A business object has an owner name, profit, and tax percentage.
o Include a constructor that receives a business information as parameters and use it to set a business object. o Class business should implement the Tax interface, as follows:
It returns the business profit as the earning amount.
It returns the tax percentage to be paid by this business. o Implement get method to retrieve the business’ owner name.
o Do not apply mutator methods.
Page 2 of 4
- Class TaxDemo:
o This is a tester program to test the above classes. It should have below methods:
The calculateTax method: that accepts an amount and tax-percent x% and returns x% of the amount.
The display static method: to print the output as shown in the sample run below (Figure 2), this method
calls calculateTax to obtain tax amount for each Company/ Business object. The main method:
- Sample run1:
Asks user for input file name.
Reads objects of type Company and/or Business from the input file into two separate ArrayLists.
Where the line for a company object information starts with “c” or “C” and for a business object starts with “b” or “B”. Any other character means invalid line. See Figure 3 for a sample input file, “dataA.txt”, which is also available on Moodle.
Your code should catch and handle FileNotFoundException; see Figure 1.
For any invalid line, display an error message “Bad data Error: Invalid Type!” with line number
that caused the error. See sample output runs in Figure 2.
After reading the whole input file, it calls display method to print the output as shown in Figure2.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 6 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education