Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 18cf27a

Browse files
author
Jay Morales
committed
Add P1.19
1 parent 7b8eb17 commit 18cf27a

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package progsolutions.ch01.p19;
2+
3+
import static java.lang.System.out;
4+
5+
/**
6+
* P0119.java
7+
*
8+
* @author Jay Morales
9+
*/
10+
class P0119 {
11+
/**
12+
* main.
13+
*
14+
* @param args args
15+
*/
16+
public static void main(String[] args) {
17+
out.println(" State Tax Rates ");
18+
out.println("--------------------");
19+
out.println("New York\t\t4.0%");
20+
out.println("New Jersey\t\t6.6%");
21+
out.println("Connecticut\t\t6.3%");
22+
out.println("Vermont\t\t\t6.0%");
23+
out.println("Florida\t\t\t6.0%");
24+
}
25+
}

‎src/progsolutions/ch01/p19/README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[Back](../README.md)
2+
3+
## Business P1.19
4+
5+
In the United States there is no federal sales tax, so every state may impose its own sales taxes. Look on the Internet for the sales tax charged in five U.S. states, then write a program that prints the tax rate for five states of your choice.
6+
7+
```bash
8+
Sales Tax Rates
9+
---------------
10+
Alaska: 0%
11+
Hawaii: 4%
12+
. . .
13+
```
14+
15+
---
16+
17+
Solution:
18+
19+
```java
20+
import static java.lang.System.out;
21+
22+
class P0119
23+
{
24+
public static void main(String[] args)
25+
{
26+
out.println(" State Tax Rates ");
27+
out.println("--------------------");
28+
out.println("New York\t\t4.0%");
29+
out.println("New Jersey\t\t6.6%");
30+
out.println("Connecticut\t\t6.3%");
31+
out.println("Vermont\t\t\t6.0%");
32+
out.println("Florida\t\t\t6.0%");
33+
}
34+
}
35+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /