All is well as long as the number of quiz questions ($b) isn't greater than 100.
Unfortunate for me, but great for the Marines, there are 3 quizzes that are greater than 150 questions and when the Marines run those quizzes, the value of ($b=.66) is rounded to 0 and they all make 100's regradless of the number of wrong answers.
Does any one have a fix? Oh, one last thing, I am stuck with the shells that come bundled with Solaris 9.
If you are using #!/bin/ksh, that is the '88 version of the Korn shell, and floats are not supported. They are not supported until the '93 version. On Solaris 9, the desk top version, dtksh, is 93 compliant:
Nails, that worked great! I used the dtsk example. One last request if I might. Is there a way of having the return be only two space holders after the decimal point? i.e.,
If you use the bc command to perform the arithmetic, you can use the scale command as I did in the above example. If you don't, the printf command can be used to format a number:
Nails thank you very much, that worked great! In this world of knowledge is power, its refreshing to know that some people are still willing to share they're intellect.
Thank you for the compliment, but it's more experience than intellect. I'm just replying to the kindness paid me. I believe the young people call it "paying it forward".
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE