一道JAVA作业题,不会做,可明天要交,大神们就帮帮我吧。原题如下:
LastmonthJoepurchasedsomestockinAcmesoftware,Inc.Herearethedetailsofthepurchase:ɧ...
Last month Joe purchased some stock in Acme software, Inc. Here are the details of the purchase:
The number of shares that Joe purchased was 1,000.
When Joe purchased the stock, the paid $32.87 per share.
Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock.
Two weeks later Joe sold the stock. Here are the details of the sale:
The number of shares that Joe sold was 1,000.
He sold the stock for $33.92 per share.
He paid his stockbroker another commission that amounted to 2% of the amount he sold for the stock.
Write a program that displays the following information:
The amount of money Joe paid for the stock.
The amount of commission Joe paid his broker when he bought the stock.
The amount that Joe sold the stock for.
The amount of commission Joe paid his broker when he sold the stock.
Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the amount of profit that your program displays is negative number, then Joe lost money on the transaction.)
上个月乔购买了一些股票在Acme软件公司。这里的细节是购买:
乔购买的股份数是1000,。
当时乔购买股票,每股支付32.87美元。
乔支付他的股票经纪人佣金,相当于2%的金额他付了股票。
两个星期后乔卖掉了股票。这里的细节是销售:
乔出售的股票数就是1000。
他卖掉了股票为每股33.92美元。
他付给他的股票经纪人,另一个委员会,达2%的金额他卖股票。
编写一个程序,显示以下信息:
乔支付的股票的钱数
当他买了股票,乔支付他的经纪人佣金数
乔卖掉了股票的金额。
当他卖了股票,乔支付他的经纪人佣金数
显示多少利润,乔后出售他的股票和支付佣金给他的两个代理。(如果数量的利润,你的程序显示是负数,那么乔赔钱的交易)。 展开
The number of shares that Joe purchased was 1,000.
When Joe purchased the stock, the paid $32.87 per share.
Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock.
Two weeks later Joe sold the stock. Here are the details of the sale:
The number of shares that Joe sold was 1,000.
He sold the stock for $33.92 per share.
He paid his stockbroker another commission that amounted to 2% of the amount he sold for the stock.
Write a program that displays the following information:
The amount of money Joe paid for the stock.
The amount of commission Joe paid his broker when he bought the stock.
The amount that Joe sold the stock for.
The amount of commission Joe paid his broker when he sold the stock.
Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the amount of profit that your program displays is negative number, then Joe lost money on the transaction.)
上个月乔购买了一些股票在Acme软件公司。这里的细节是购买:
乔购买的股份数是1000,。
当时乔购买股票,每股支付32.87美元。
乔支付他的股票经纪人佣金,相当于2%的金额他付了股票。
两个星期后乔卖掉了股票。这里的细节是销售:
乔出售的股票数就是1000。
他卖掉了股票为每股33.92美元。
他付给他的股票经纪人,另一个委员会,达2%的金额他卖股票。
编写一个程序,显示以下信息:
乔支付的股票的钱数
当他买了股票,乔支付他的经纪人佣金数
乔卖掉了股票的金额。
当他卖了股票,乔支付他的经纪人佣金数
显示多少利润,乔后出售他的股票和支付佣金给他的两个代理。(如果数量的利润,你的程序显示是负数,那么乔赔钱的交易)。 展开
8个回答
展开全部
public class Test {
public static void main(String[] args) {
int i =1000;
Double d1 = 32.87;
Double d2 = 33.92;
Double d3 = 0.02;
System.out.println("乔支付的股票的钱数:"+i*d1);
System.out.println("乔支付他的经纪人佣金数:"+i*d1*d3);
System.out.println("乔卖掉了股票的金额:"+i*d2);
System.out.println("乔支付他的经纪人佣金数:"+i*d2*d3);
Double d4 = i*d2-i*d1-i*d1*d3-i*d2*d3;
if(d4<0){
System.out.println("乔赔钱:"+(-d4));
}else{
System.out.println("乔利润:"+d4);
}
}
}
public static void main(String[] args) {
int i =1000;
Double d1 = 32.87;
Double d2 = 33.92;
Double d3 = 0.02;
System.out.println("乔支付的股票的钱数:"+i*d1);
System.out.println("乔支付他的经纪人佣金数:"+i*d1*d3);
System.out.println("乔卖掉了股票的金额:"+i*d2);
System.out.println("乔支付他的经纪人佣金数:"+i*d2*d3);
Double d4 = i*d2-i*d1-i*d1*d3-i*d2*d3;
if(d4<0){
System.out.println("乔赔钱:"+(-d4));
}else{
System.out.println("乔利润:"+d4);
}
}
}
展开全部
上个月乔购买了一些股票在Acme软件公司。这里的细节是购买:
乔购买的股份数是1000,。
当时乔购买股票,每股支付32.87美元。
乔支付他的股票经纪人佣金,相当于2%的金额他付了股票。
两个星期后乔卖掉了股票。这里的细节是销售:
乔出售的股票数就是1000。
他卖掉了股票为每股33.92美元。
他付给他的股票经纪人,另一个委员会,达2%的金额他卖股票。
编写一个程序,显示以下信息:
乔支付的股票的钱数
当他买了股票,乔支付他的经纪人佣金数
乔卖掉了股票的金额。
当他卖了股票,乔支付他的经纪人佣金数
显示多少利润,乔后出售他的股票和支付佣金给他的两个代理。(如果数量的利润,你的程序显示是负数,那么乔赔钱的交易)。
乔购买的股份数是1000,。
当时乔购买股票,每股支付32.87美元。
乔支付他的股票经纪人佣金,相当于2%的金额他付了股票。
两个星期后乔卖掉了股票。这里的细节是销售:
乔出售的股票数就是1000。
他卖掉了股票为每股33.92美元。
他付给他的股票经纪人,另一个委员会,达2%的金额他卖股票。
编写一个程序,显示以下信息:
乔支付的股票的钱数
当他买了股票,乔支付他的经纪人佣金数
乔卖掉了股票的金额。
当他卖了股票,乔支付他的经纪人佣金数
显示多少利润,乔后出售他的股票和支付佣金给他的两个代理。(如果数量的利润,你的程序显示是负数,那么乔赔钱的交易)。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-10-08
展开全部
。。。如果只需要控制台答应的话~不就都是一些算术题么~system.out.println();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
考英文了吗
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
C++还是C#?
追问
java
追答
int pay = 1000;
double qian = 32.87;
double hou = 33.92;
System.out.println("买股钱数:"+pay*qian);
System.out.println("给经纪人钱数:"+pay*qian*0.02);
System.out.println("卖股钱数:"+pay*hou);
System.out.println("给经纪人钱数:"+pay*hou*0.02);
System.out.println("利润:"+(pay*hou*0.02-pay*qian*0.02));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
怎么全是英文啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询