Question: in kotlin code this data class Course ( ( val name: String, val year : Int, val credits : Double, var grade :Int, val ap

in kotlin code this data class Course ((
val name: String,
val year : Int,
val credits : Double,
var grade :Int,
val ap : Boolean))
use the Course data class
- create an arraylist of your current classes
- calculate your gpa
--- loop thru arraylist for each class:
------ calculate grade points
------ calculate quality points, add to total quality points
------ add credits to total credits
functions:
gradePoints - takes a numeric grade 01000-100 and ap
-- returns grade points using the following scale:
94+>4.0(----94+->4.0(A,,A+)+)
9093>3.75(----90-93->3.75(A)-)
8789>3.5(----87-89->3.5(B+)+)
8486>3.0(----84-86->3.0(B))
8083>2.75(----80-83->2.75(B)-)
7779>2.5(----77-79->2.5(C+)+)
7476>2.0(----74-76->2.0(C))
7073>1.75(----70-73->1.75(C)-)
69>0.00(----69-->0.00(NP))
if ((ap and passing)+1.0)+1.0
qualityPoints - takes grade points and credits
-- returns grade points ** credits
gpa == total quality points // total credits ((P//F classes don't count towards your gpa))
credits:
full year 11 period =5.0=5.0
33 MP =3.75=3.75
22 MP =2.50=2.50
11 MP =1.25=1.25
double period =*2=*2

Step by Step Solution

3.38 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Kotlin implementation of the described scenario data class Course val name String val year Int val c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!