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
-
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...
-
Sunto Scientific manufactures GPS devices for a chain of retail stores. Its most popular model, the Magellan XS, is assembled in a dedicated facility in Savannah, Georgia. Sunto is keenly aware of...
-
Fort Services initially records all prepaid expenses as expenses and all unearned revenues as revenues. Given the following information, prepare the necessary adjusting entries at December 31, 2023,...
-
In February 2007, The Elliot Group, Inc., an Illinois real estate developer, made a deal with the Village of Arlington Heights to develop property in that village. Arlington Market, LLC, was...
-
Dudley Calendars imprints calendars with college names. The company has fixed expenses of $ 1,125,000 each month plus variable expenses of $ 4.50 per carton of calendars. Of the variable expense, 74%...
-
Create a table in excel showing net present value calculation for the following scenario. You will have a column with time period, future value, and present value included. You can anticipate that...
-
Consider the following January transactions: 1. On January 1, 20X1, three persons, James, Bosh, and Wade, formed JBW Corporation. JBW is a wholesale distributor of electronic equipment. The company...
-
How do cellular organelles, such as mitochondria and peroxisomes, coordinate metabolic processes through compartmentalization and organelle-specific metabolic pathways, ensuring efficient energy...
-
6. Given the following circuit Input A B Input> Complete the truth table below E A B D E 0 0 0 1 1 0 1 1 >Output [4 marks]
-
Elaborar un estado de siruacin financiera, construir para poder tomar una decisin dentro de la gerencia, se incrusta el archivo que se trabajara para poder esclarecer el tema, una vez que ya los...
-
3. Consider a two-product, one-person economy. This person assigns 8 hours per day to work. He can either catch fish or gather apple. He can catch one fish per hour or 2 apples per hour. his utility...
-
Bob and Larry have been working at their organization for the same amount of time, and they seem to work equally hard at their work and contribute about the same amount to their organization. Bob has...
-
Question 6 a) Suppose an M&A advisor believes that any premium over current market pricing paid for a particular target would be over-priced. Is there a scenario where a target company appears...
-
Need to find derivative and set derivative=0 to find the zeros which give tangent lines of the original question Consider the function f(x) = cos(x)In cos (x) ] [-17]. . on the interval %3D
-
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...
-
A running mountain lion can make a leap 10.0 m long, reaching a maximum height of 3.0 m. a. What is the speed of the mountain lion just as it leaves the ground? b. At what angle does it leave the...
-
The moon completes one (circular) orbit of the earth in 27.3 days. The distance from the earth to the moon is 3.84 10 8 m. What is the moons centripetal acceleration?
-
A soccer player takes a free kick from a spot that is 20 m from the goal. The ball leaves his foot at an angle of 32, and it eventually hits the crossbar of the goal, which is 2.4 m from the ground....
Study smarter with the SolutionInn App