xihaifeng1988
xihaifeng1988
关注数: 5
粉丝数: 1
发帖数: 265
关注贴吧数: 19
关于条形码的一个简单小程序-欢迎鉴赏-批评 源代码: import java.util.Scanner; public class BarCodeDemo { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.println("请输入条形码"); String a =console.nextLine(); int i=1,sum1=0,sum2=0,sum=0; for(;i<=11;i+=2){ sum1+=a.charAt(i)-'0'; } sum1=sum1*3; for(i=2;i<=11;i+=2){ sum2+=a.charAt(i)-'0'; } sum=sum1+sum2; int d=(sum/10+1)*10; if(sum%10==0)d=sum; int code=d-sum; if(a.charAt(0)-'0'==code){ System.out.println("条形码正确"); }else{ System.out.println("请重新扫描"); } } }
求补全 import java.lang.reflect.Array; import java.sql.Struct; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class CompoundsInterestDemo { public static void main(String[] args) { // TODO Auto-generated method stub double interest=0.064,futureValue,presentValue=1000000; int year=5; futureValue=payforonce(year,interest,presentValue); System.out.println(futureValue); int month = year*12 ; long principal=1000000; double monthlyInterestRate = interest/12; double MatchingInterestPayment; MatchingInterestPayment = MatchingInterestPayment(principal,monthlyInterestRate,month); System.out.println(MatchingInterestPayment); Scanner console = new Scanner(System.in); int d = console.nextInt(); year = d; futureValue=payforonce(year,interest,presentValue); System.out.println(futureValue); month = year*12 ; monthlyInterestRate = interest/12; MatchingInterestPayment = MatchingInterestPayment(principal,monthlyInterestRate,month); System.out.println(MatchingInterestPayment); } public static double payforonce (int year, double interest,double presentValue){ double futureValue ; futureValue = presentValue*Math.pow(interest+1, year); return futureValue; } public static double MatchingInterestPayment(long principal,double monthlyInterestRate,int month){ double monthlyRepaymentAmount; monthlyRepaymentAmount =principal*monthlyInterestRate*Math.pow(monthlyInterestRate+1,month)/(Math.pow(monthlyInterestRate+1,month)-1); return monthlyRepaymentAmount; } public static ArrayList MatchingMonthlyRepaymentofPrincipal(long principal,int month,long paidprincipal,double monthlyInterestRate,int PayMonths){ double MonthlyPayPrincipal=(double)principal/12; double MonthLyInterest=(principal-MonthlyPayPrincipal*PayMonths)*monthlyInterestRate; double TotalInterest=(month+1)*principal*monthlyInterestRate/2; double TotalPay=TotalInterest+principal; ArrayList list=new ArrayList(); list.add(MonthlyPayPrincipal); list.add(TotalInterest); list.add(TotalPay); return list; } }
橙色了,纪念一下,整整三十天 时间不长,但能坚持下来,也是一种收获,做事情需要持之以恒,坚持不懈,赞一下
新手,初来咋到,请各位大神多多关照 我的文库财富值5000多
终于第一个签到了,纪念一下
See_7月21日_jQuery_学习_情况及22日学习内容 7月21日7月22日规划
1
下一页