日期:2014-05-20  浏览次数:20736 次

一道要求挺多的JAVA题
import   java.util.Scanner;

public   class   TutorialMark
{
        public   static   void   main   (String[]   args)
        {

final   double   IN_TUTE_PERCENT   =   0.7;  
final   double   OUT_TUTE_PERCENT   =   0.3;  
final   int   ONE_HUNDRED   =   100;  


int   beforeTuteMark;
int   beforeTuteMax;    
int   tuteMarks;            
int   tuteMax;              
int   afterTuteMarks;  
int   afterTuteMax;      
int   outTuteAvg;    
int   inTutePercent;
double   tuteMark;    

Scanner   scan   =   new   Scanner(System.in);


System.out.println( "\nThis   is   your   Tutorial   Mark   Calculator   -   Welcome\n ");
System.out.print( "Please   enter   the   mark   you   gained   for   the   before-Tutorial   test:   ");
beforeTuteMark   =   scan.nextInt();
System.out.print( "Please   enter   the   maximum   available   marks   for   the   before-Tutorial   test:   ");
beforeTuteMax   =   scan.nextInt();
System.out.print( "Please   enter   the   number   of   marks   you   gained   for   the   in-Tutorial   test:   ");
tuteMarks   =   scan.nextInt();
System.out.print( "Please   enter   the   maximum   available   marks   for   the   in-Tutorial   test:   ");
tuteMax   =   scan.nextInt();
System.out.print( "Please   enter   the   number   of   marks   you   gained   for   the   after-Tutorial   test:   ");
afterTuteMarks   =   scan.nextInt();
System.out.print( "Please   enter   the   maximum   available   marks   for   the   after-Tutorial   test:   ");
afterTuteMax   =   scan.nextInt();
System.out.println();

outTuteAvg   =   beforeTuteMark   +   afterTuteMarks   /   beforeTuteMax   +   afterTuteMax   *   ONE_HUNDRED;


inTutePercent   =   tuteMarks   /   tuteMax   *   ONE_HUNDRED;


tuteMark   =   OUT_TUTE_PERCENT   *   outTuteAvg   +   IN_TUTE_PERCENT   *   inTutePercent;

System.out.println( "You   achieved   an   average   mark   for   your   out-of-Tutorial   test   of   "   +   outTuteAvg   +   "% ");  
System.out.println( "You   achieved   a   mark   for   your   in-Tutorial   test   of   "   +   inTutePercent   +   "% ");
System.out.println( "Your   final   Tutorial   mark   is   "   +   tuteMark   +   "% ");
System.out.println();
        }
}
这么一个类...


要求:
修改TutorialMark的类
1把TutorialMark的类修改到正确的数学表达式,使这个程序能正确计算出结果。*参照上述例子的计算方法。
2修改TutorialMark的类使两部分占最终评估的比重有效(那两个百分数,例子里的70%跟30%),且可以被使用者输入:
•提示使用者这两个比重