package practice;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class test1110 {
public static void main(String args[])throws Exception{
 BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
 
 int chicredit=3,engcredit=2,mancredit=3,procredit=3,stacredit=3,
 chiscore,engscore,manscore,proscore,stascore,total;
 int choice;
 String chi="國文",eng="英文",man="管理學",pro="程設",sta="統計學",num;
 
 boolean doit = true;
 while(doit){
 
 System.out.println("請輸入成績");
 chiscore=Integer.parseInt(br.readLine());
 System.out.println("請輸入成績");
 engscore=Integer.parseInt(br.readLine());
 System.out.println("請輸入成績");
 manscore=Integer.parseInt(br.readLine());
 System.out.println("請輸入成績");
 proscore=Integer.parseInt(br.readLine());
 System.out.println("請輸入成績");
 stascore=Integer.parseInt(br.readLine());
 
  total = (chiscore*chicredit+engscore*engcredit+manscore*mancredit+proscore*procredit+stascore*stacredit)/(chicredit+engcredit+mancredit+procredit+stacredit);
 
 System.out.println("學號:"+"\t"+"4020Q090");
 System.out.println("姓名:"+"\t"+"李依靜");
 System.out.println("科目:"+"\t"+chi+"\t"+eng+"\t"+man+"\t"+pro+"\t"+sta);
 System.out.println("學分數:"+"\t"+chicredit+"\t"+engcredit+"\t"+mancredit+"\t"+procredit+"\t"+stacredit);
 System.out.println("學期成績:"+"\t"+total);
 
if(total>80)
 System.out.println("等第="+"\t"+"A");
else if(total>=60) 
 System.out.println("等第="+"\t"+"B");
else
 System.out.println("等第="+"\t"+"C");
 

System.out.println("是否繼續執行?是請輸入1");
num=br.readLine();

 if(num.equals("1"))
  doit= true;
 else{
  doit = false;
 System.out.println("程式執行結束");
  
  
}

}}}

 

 

 

arrow
arrow
    全站熱搜

    玥君 發表在 痞客邦 留言(0) 人氣()