Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your output should look like this: Decisions (if/else, switch/case, relational operators) Exercise 1: New Sales Tax in Metro Atlanta Area (10pt) Starting from April 1,

image text in transcribedYour output should look like this:image text in transcribed

Decisions (if/else, switch/case, relational operators) Exercise 1: New Sales Tax in Metro Atlanta Area (10pt) Starting from April 1, 2018, the sales tax rates in the metro Atlanta area have been increased to the following: County Inside City of Atlanta? Sales Tax Rate Yes 8.9% Fulton No 7.75% Yes 8.9% Dekalb No 8.0% Cobb N/A 6.0% Write a simple Java program to determine the sales tax rate for any location within the metro Atlanta area. Save it as Hw3_Ex1.java. Your program should: (i) Prompt the user to enter the county: 1 for Fulton; 2 for Dekalb; 3 for Cobb; (ii) If in the Fulton or Dekalb county, prompt the user to enter whether the location is inside the city of Atlanta or not: 1 for Yes; 2 for No; If in the Cobb county, then no need to check; (iii) Determine the sales tax rate using the nested branches and multiple alternatives approaches as discussed in class. Hints: Two levels of if-else statements (The first level is about the county, the second level is about whether it is inside the city of Atlanta or not) To determine the county, use if...else if... else statement. (iv) Print out the sales tax rate; C. Command Prompt C:\test>javac Hw3_Ex1.java C:\test>java Hw3_Ex1 County (1. Fulton; 2. Dekalb; 3. Cobb): 1 Inside City of Atlanta? (1. Yes; 2. No): 1 The sales tax rate is: 8.9% C:\test>java Hw3_Ex1 County (1. Fulton; 2. Dekalb; 3. Cobb): 2 Inside City of Atlanta? (1. Yes; 2. No: 2 The sales tax rate is: 8.0% C:\test>java Hw3_Ex1 County (1. Fulton; 2. Dekalb; 3. Cobb>: 3 The sales tax rate is: 6.0% C:\test>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

1. Who is responsible for resolving this dilemma?

Answered: 1 week ago