为什么当我尝试将所有分数都设为1时我得到0个答案


-5
#!/bin/zsh
echo "enter quiz1 score:"
read quiz1
echo "enter quiz2 score:"
read quiz2
echo "enter seatwork score:"
read seatwork
echo "enter exam score:"
read exam
echo "enter lab1 score:"
read lab1
echo "enter lab2 score:"
read lab2
echo "enter lab3 score:"
read lab3

quiz1total=$((quiz1/20))
quiz2total=$((quiz2/30))
quiztotal=$(($quiz1total+$quiz2total))
quizaverage=$(($quiztotal*.20))
examtotal=$(($exam/50))
examaverage=$(($examtotal*.40))
seatworktotal=$((%seatwork/20))
seatworkaverage=$((seatworktotal*.20))
labtotal=$(($lab1+$lab2+$lab3))
labtotals=$(($labtotal/300))
labaverage=$(($labtotals*.20))
midterm=$(($quizaverage+$examaverage+$seatworkaverage+$labaverage))
midtermgrade=$(($midterm*100)
echo "your midterm grade is: $midtermgrade"

测验1总分是20测验2总分是30考试总分是50功课总分是20中期成绩=平均测验20%功课20%考试40%实验室20%
Johnrey

欢迎来到Ask Ubuntu!请阅读如何提问。调试问题更适合于Stack Overflow,但是无论哪种方式,请发布一个Minimal,Complete和Verifiable示例
wjandrea

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.