im really a newbie in Visual Basic and i am asked to produce calculations of grades a user may input..
here are the formulas..
Qave=((Q1+Q2)/2*0.2
Att=Attendance * 0.05
Exam=Exam * 0.75
Lecgrade=Qave+Att+Exam
MPave=((MP1+MP2)/2*0.5
LabExam=Lab*5
LabGrade=(MPave+LabExam)
FinalGrade=((LecGrade*0.5)+(LabGrade*0.5))
honestly, i find it really difficult bec im not so much familiar of the commands in VB such as Dim etc.. so i hope u could help me.. tnx in advance
18-01-2006 at 02:56 AM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1617
Re: COMPUTAION of GRADES
What is it that you're needing then?
If you're wondering about the types for the variables... if you want it automatically rounded (i.e. don't care about the decimal) they can be integer, otheriwse single
____________________________ Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
18-01-2006 at 05:48 AM
|
xtramac Level: Professor Registered: 28-08-2005 Posts: 89
Re: COMPUTAION of GRADES
hello,
i think i can relate to your question for some reasons. for grades you need to do declare all you variables as single since you will of course be considering the fractional part of the grades/scores.
to declare it u may do this:
[vbcode]
dim Qave as Single
'assuming that you have also declared q1 & q2
Qave = ((Q1 + Q2))/2 * .2