- 分享
- 0
- 人气
- 0
- 主题
- 1
- 帖子
- 1
- UID
- 432549
- 积分
- -1
- 阅读权限
- 1
- 注册时间
- 2011-7-21
- 最后登录
- 2011-10-16
- 在线时间
- 0 小时
|
本帖最后由 Alex8889 于 2011-8-3 11:38 AM 编辑
Question:
To make a profit, a local store marks up the prices of its items by a certain percentage. Write a Java program that reads the original price of the item sold, the percentage of the marked-up price, and the sales tax rate. The program then outputs the original price of the item, the marked-up percentage of the item, the store’s selling price of the item, the sales tax rate, the sales tax, and the final price of the item. (The final price of the item is the selling price plus the sales tax).
-->How I add IN the Formula:
Here is My Code:
import java.util.*;
public class Main {
public Main() {
}
public static Scanner inFile=new Scanner(System.in);
public static void main(String[] args) {
double orginal_price;
double final_price;
double item_sold;
double marked_up_price;
double percentage;
double sales_tax;
System.out.println("Enter orginal price: ");
orginal_price = inFile.nextDouble();
System.out.println("Enter item sold: ");
item_sold = inFile.nextDouble();
System.out.println("Enter marked up price: ");
marked_up_price = inFile.nextDouble();
System.out.println("Enter percentage: ");
percentage= inFile.nextDouble();
System.out.println("Enter sale tax: ");
sales_tax = inFile.nextDouble();
System.out.println("Enter final price: ");
final_price = inFile.nextDouble();
System.out.println ("Enter The original price of the item:"+orginal_price);
System.out.println ("Marked up percentage of the item:"+marked_up_price);
System.out.println ("The selling price:="+percentage);
System.out.println ("Sales Tax Rate: "+sales_tax);
System.out.println ("The Final price:"+ final_price);
inFile.close();
}
} |
-
总评分: 积分 -2
查看全部评分
|