public class CetScoreChange
{
public static void main(String[] args)
{
int[] score = {129, 245, 167, 54};
int[] origiScore;
float[] percentage= {0.2, 0.4, 0.25, 0.15};
float origiScoreTotal= 0;
int i;
int total=0;
String[] subject = {"Listening", "Reading", "Synthesis", "Composition"};
System.out.println ("The total score of each part is 71...");
for ( i=0; i< score.length; i++)
{
System.out.println(subject[i]);
System.out.println(score[i]);
total =total + score[i];
}
System.out.println("Your total score is " + total );
System.out.println("Now, the originalitily score is")
for ( i=0; i< score.length; i++)
{
    System.out.println(subject[i]);
    origiScore[i]= (score[i] / percentage[i])/ 10;
    origiScoreTotal= origiScoreTotal + origiScore[i];
    System.out.println(origiScore[i]);
}
System.out.println("Your CET4 socre have been changed to 100 percentage is" + origiScoreTotal );
}
}
//';' expected..

解决方案 »

  1.   

    把CET4 710分数制换算成100分制...
      

  2.   

    public class CetScoreChange
    {
    public static void main(String[] args)
    {
    int[] score = {129, 245, 167, 54};
    int[] origiScore ;
    float[] percentage= {0.2f, 0.4f, 0.25f, 0.15f};
    float origiScoreTotal= 0;
    int i;
    int total=0;
    String[] subject = {"Listening", "Reading", "Synthesis", "Composition"};
    System.out.println ("The total score of each part is 71...");
    for ( i=0; i< score.length; i++)
    {
    System.out.println(subject[i]);
    System.out.println(score[i]);
    total =total + score[i];
    }
    System.out.println("Your total score is " + total );
    System.out.println("Now, the originalitily score is");
    origiScore = new int[score.length];
    for ( i=0; i< score.length; i++)
    {
        System.out.println(subject[i]);
        origiScore[i]= (int)(score[i] / percentage[i])/ 10;
        origiScoreTotal= origiScoreTotal + origiScore[i];
        System.out.println(origiScore[i]);
    }
    System.out.println("Your CET4 socre have been changed to 100 percentage is" + origiScoreTotal );
    }
    }
      

  3.   

    有两个问题float[] percentage= {0.2f, 0.4f, 0.25f, 0.15f}; 类型不匹配
    origiScore = new int[score.length]; 数组分配空间
      

  4.   

    int[] score = {129, 245, 167, 54};
    d加起来是710?