Java Programming Please make sure your code is working correctly and I will give you a good
Fantastic news! We've Found the answer you've been seeking!
Question:
Java Programming Please make sure your code is working correctly and I will give you a good review! Thank you very much!!!
Transcribed Image Text:
Key Steps: 1. Create a new class Taxation in a new NetBeans project Taxation with package taxation. It imports/ makes use of the class java.util. Scanner. import java.util.Scanner; // package and class declaration // starting point of the program public static void main(String[] args) { } // create a new Scanner object, named keyboard Scanner keyboard = new Scanner(System.in); System.out.print ("Total Income: $"); double totalIncome keyboard. next Double(); 2. You should use the Scanner class to create a single keyboard object once for obtaining user input from the console interactively. The message keyboard. next Double () waits and reads a number from the user through the keyboard. You shall reuse the keyboard object. 3. The program should validate (check) the user inputs: a) We assume that the user always keys in numeric values. Otherwise, let the program die with an Exception. That is, we allow the program to terminate abnormally. b) All three user input values should be non-negative. On encountering any negative input. print an error message "Invalid input!" and then end the program right away. c) Need NOT check or adjust the Deductions and Allowances against Total Income. d) Note that Net Chargeable Income (a derived/ calculated value) and Net Income (another derived/ calculated value) in the formula should not be negative. If it is the case, adjust them to zero. 4. For the Year of Assessment 2021/22, a reduction of 100% of the final tax payable under salaries tax would be applicable, subject to the maximum of HK$10,000 per case. Therefore, in the sample on the previous page, the Final Salaries Tax Payable is $4600. 5. To print a number with 1 decimal place, you may use System.out.printf("%.1f\n", answer); // send printf() message The first parameter in the message, "%.1f\n", is called format, that indicates printing a floating-point number with 1 decimal place. The second parameter, answer, is a floating-point value of double-type in this assignment. "\n" in the format means printing a new line. 6. Edit/ (Build): Compile/ Run/ Debug your program. If you do something wrong, don't panic. Double-click on the first error message. Check it, correct it and re-compile. Remember that a single mistake may trigger dozens of error messages. Always tackle the first one first. Be reminded that the error message itself as well as the indicated line number may not be accurate. 7. Thoroughly Test Run your program (press the function key [F6] on the keyboard) with different innut data cate such an extrama valuar and invalid inpute Eniou your work Key Steps: 1. Create a new class Taxation in a new NetBeans project Taxation with package taxation. It imports/ makes use of the class java.util. Scanner. import java.util.Scanner; // package and class declaration // starting point of the program public static void main(String[] args) { } // create a new Scanner object, named keyboard Scanner keyboard = new Scanner(System.in); System.out.print ("Total Income: $"); double totalIncome keyboard. next Double(); 2. You should use the Scanner class to create a single keyboard object once for obtaining user input from the console interactively. The message keyboard. next Double () waits and reads a number from the user through the keyboard. You shall reuse the keyboard object. 3. The program should validate (check) the user inputs: a) We assume that the user always keys in numeric values. Otherwise, let the program die with an Exception. That is, we allow the program to terminate abnormally. b) All three user input values should be non-negative. On encountering any negative input. print an error message "Invalid input!" and then end the program right away. c) Need NOT check or adjust the Deductions and Allowances against Total Income. d) Note that Net Chargeable Income (a derived/ calculated value) and Net Income (another derived/ calculated value) in the formula should not be negative. If it is the case, adjust them to zero. 4. For the Year of Assessment 2021/22, a reduction of 100% of the final tax payable under salaries tax would be applicable, subject to the maximum of HK$10,000 per case. Therefore, in the sample on the previous page, the Final Salaries Tax Payable is $4600. 5. To print a number with 1 decimal place, you may use System.out.printf("%.1f\n", answer); // send printf() message The first parameter in the message, "%.1f\n", is called format, that indicates printing a floating-point number with 1 decimal place. The second parameter, answer, is a floating-point value of double-type in this assignment. "\n" in the format means printing a new line. 6. Edit/ (Build): Compile/ Run/ Debug your program. If you do something wrong, don't panic. Double-click on the first error message. Check it, correct it and re-compile. Remember that a single mistake may trigger dozens of error messages. Always tackle the first one first. Be reminded that the error message itself as well as the indicated line number may not be accurate. 7. Thoroughly Test Run your program (press the function key [F6] on the keyboard) with different innut data cate such an extrama valuar and invalid inpute Eniou your work
Expert Answer:
Answer rating: 100% (QA)
The answer provided below has been developed in a clear step by step mannerStep 1 code package and c... View the full answer
Related Book For
Microeconomics
ISBN: 9781464146978
1st Edition
Authors: Austan Goolsbee, Steven Levitt, Chad Syverson
Posted Date:
Students also viewed these programming questions
-
Balance Sheets Assots Cash Accounts receivable Inventory Marketable securities (available for sale) Equipment Accumulated depreciation Land Total assets Liabilities and equity Liabilities Accounts...
-
Module / Discussion 31 C Module 7: Discussion Forum 57 FO Your flashlight is getting dimmer and dimmer, so you assume the batteries are nearly dead. They are "D" cells producing 1.5 volts. You take...
-
The annual association meeting of your the electric power industry will take place soon. There have been questions sked to present a report regarding the current status of the federal budget and...
-
There is a crop that the value p next month is random. The value can be either small p=1 or large P=3 depending on the weather. Half of people are optimists believing the value of the crop will be...
-
In a survey of 1,200 social media users, 76% said it is okay to friend coworkers, but 56% said it is not okay to friend your boss. a. Construct a 95% confidence interval estimate for the population...
-
In the chapter discussion of the merger between HP and Compaq, HP director Sam Ginn initially voiced doubts about the deal. However, the McKinsey experts retorted that even a slim profit in PCs would...
-
Calculation of Revenue from Cash Collection} Anderson Lawn Service provides mowing, weed control, and pest management services for a flat fee of \(\$ 140\) per lawn per month. During July, Anderson...
-
The typical subway station in Washington, D.C., has 6 turnstiles, each of which can be controlled by the station manager to be used for either entrance or exit control-but never for both. The manager...
-
2. [0\" Points] DETAILS PREVIOUS ANSWERS LARAPCALC1II] 4.1.006.M|. Beginning Iwith 25 grams of a radioactive element whose half-life is 35 years, the mass y (in grams) remaining after tvears i5 given...
-
Clayton is considering opening a security company in his town that will provide body guards and security officers for both ndividuals and businesses. Based on his research, Clayton identifies five pot
-
Discuss the principles of population genetics and the mechanisms driving genetic variation within and between populations, including genetic drift, gene flow, mutation, and natural selection, and...
-
Refer to Java Inc.'s. information provided here: Assets 2023 2022 Liabilities and Shareholders' Equity 2023 2022 Accounts receivable 34,125 39,825 Accounts payable 28,800 33,750 Accumulated...
-
How do you calulate under and overallocated manufacturing overhead as a write of and dispose at the end of the year and how would you make these adjustments to Cost of Goods Solds.
-
QUESTION 6 If Pearson correlation coefficient of independent variable (X) and dependent variable (Y) is 0.75, what would be the coefficient of determination (hence, r2) rounded up to two decimal...
-
Q3. What is the after tax cost of finance using the 27.5% p.a. company tax rate? Q4. Including the capital repayments what is the total amount to be repaid over 3 years?
-
2 points The pre-frontal cortex (rider) part of your brain is most involved in planning your future financial transactions and the limbic (elephant) part of your brain is most involved with how you...
-
Hardin Services Co. experienced the following events in 2016: 1. Provided services on account. 2. Collected cash for accounts receivable. 3. Attempted to collect an account and, when unsuccessful,...
-
Suppose that the inverse market demand for pumpkins is given by P = $10 - 0.05Q. Pumpkins can be grown by anybody at a constant marginal cost of $1. a. If there are lots of pumpkin growers in town so...
-
For the following production functions, Find the marginal product of each input. Determine whether the production function exhibits diminishing marginal returns to each input. Find the marginal...
-
Elaine loves receiving flowers and has a particular fondness for daisies and daffodils. Her relative preferences for the two flowers are illustrated by the set of utility curves in the diagram. The...
-
Using the data in Your Turn 13.5, how much water would be saved in a month if one-third of a town's population of 15,000 turned the faucet off when brushing their teeth except when rinsing?
-
Using the data in Example 13.5, how much water would be saved in a year if one-sixth of the population of the state of Florida, which is approximately 21.6 million people, turned the faucet off when...
-
Hurd Inc. prepays rent every three months on March 1, June 1, September 1, and December 1. Rent for the three months totals \(\$ 3,600\). On December 31, 2018, Hurd will report Prepaid Rent of: a....
Study smarter with the SolutionInn App