JBTALKS.CC

标题: nid professional programmer some help......thx alot ..... [打印本页]

作者: Alex8889    时间: 2011-8-3 09:39 AM
标题: nid professional programmer some help......thx alot .....
本帖最后由 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();

    }
   
}




欢迎光临 JBTALKS.CC (https://jbtalks.my/) Powered by Discuz! X2.5