
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Java Programming Question 12 error:
I have this else error in my code and not sure how to fix it. Help would be appreciated!

Transcribed Image Text:Downloads - Chapter7/src/Tax Return.java - Eclipse IDE
File Edit Source Refactor Navigate Search Project Run Window Help
Pa... X
ValidatePassword.java
Chapter7
JRE System Lib
v src
□
(default pac
> Tax Retur
>
Validatel
61°F
Mostly sunny
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
5.5
56
57
580
59
60
61
62
62
63
64
65
66
67
168
}
else
{
{
}
Tax Return.java X
if (annual Income >= 0 && annualIncome <- 20000)
(
switch (maritalStatus)
{
case "MARRIED":
}
this.taxLiability annualIncome 0.14;
break;
case "SINGLE":
}
this.taxLiability annual Income 0.15;
break;
}
else if (annual Income> 20000 && annualIncome <- 50000)
switch (marital Status)
case "MARRIED":
this.taxLiability = annualIncome * 0.20;
break;
case "SINGLE":
this.taxLiability annualIncome * 0.22;
break;
switch (marital Status)
case "MARRIED":
this.taxLiability = annualIncome * 0.20;
break;
case "SINGLE":
this.taxLiability annual Income
$
4
IDI
=
5
Writable
O Search
* 0.30;
ER T
6
Smart Insert
00
57:13: 1524
8

Transcribed Image Text:CHAPTER 7 CHARACTERS, STRINGS, AND THE StringBuilder
10. Write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered numbers
to format it as a phone number. For example, 5153458912 becomes (515)345-8912 1 the user does not ente
exactly 10 digits, display an error message. Continue to accept user input until the user enters 999. Save the
as PhoneNumberFormat.java.
11. Write an application that determines whether a phrase entered by the user is a palindrome. A palindrome
is a phrase that reads the same backward and forward without regarding capitalization or punctuation. For
example, Dot saw I was Tod, Was it a car or a cat I saw?, and Madam, I'm Adam are palindromes. Save the tea
262
12.
a.
Create a TaxReturn class with fields that hold a taxpayer's Social Security number, last name, first
constructor that requires arguments that provide values for all the fields other than the tax liability. The
name, street address, city, state, zip code, annual income, marital status, and tax liability. Include a
constructor calculates the tax liability based on annual income and marital status. The following table
shows the percentage of income that is taxed.
INCOME (S)
0-20,000
20,001-50,000
50,001 and over
SINGLE STATUS
15%
22%
30%
MARRIED STATUS
14%
20%
28%
In the TaxReturn class, also include a display method that displays all the TaxReturn data. Save the
file as TaxReturn.java.
b. Create an application that prompts a user for the data needed to create a TaxReturn. Continue to
prompt the user for data as long as any of the following are true:
> The Social Security number is not in the correct format, with digits and dashes in the appropriate
positions-for example, 999-99-9999.
> The zip code is not five digits.
> The marital status does not begin with one of the following: S, s, M, or m.
> The annual income is negative.
1.
After each item of the input data is correct, create a TaxReturn object and then display its values. Save the file
as PrepareTax.java.
c. DebugSeven3.java
d. DebugSeven4.java
Game Zone
four strings Spodes Hearts, Di
setting the numeric
NUMERIC VALUE STRO
1
Debugging Exercises
1. Each of the following files in the Chapter07 folder of your downloadable student files has syntax and/or logic
errors. In each case, determine the problem and fix the application. After you correct the errors, save each file
using the same filename preceded with Fix. For example, DebugSeven 1.java will become FixDebugSeven1.java.
a. DebugSevenl.java
b. DebugSeven2.java
2 through 10
11
12
13
Save the file as C
b. Create a War C
and declares
you assume
2. Create a
be valid
To allo-
words
Whe
con
All
n
3.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- Why would you use a traditional class i.e, Java?arrow_forwardProgramming Exercise 1-7 Instructions MovieQuotelnfo.java >- Terminal + 1 class MovieQuoteInfo { public static void main(String[] args) { // Write your code here sandbox $ | 2 Write, compile, and test the MovieQuoteInfo class so that it 3 displays your favorite movie quote, the movie it comes from, the } 5 } 4 character who said it, and the year of the movie. 6 An example of the program is shown below: Rosebud, said by Charles Foster Kane in the movie Citizen Kane in 1941. Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with your results, click the Submit button to record your score.arrow_forwardJava code to get name from user and disay Hello message In java please Use Scanner class object to get user inputarrow_forward
- Name:- MIT Note:- Please type this java code and also need an output for this given program.arrow_forwardJavaProblem 2-1 Random Number ProblemBuild an application where each time a button is clicked, a random number from 1 to 100 is displayed in a textField.arrow_forwardJava code to take name from user and print like Your name is ____arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY