Question: Write a program in Scala that computes the mean of quiz and assignment grades where you have the following defined classes // simple Scala classes
Write a program in Scala that computes the mean of quiz and assignment grades where you have the following defined classes
// simple Scala classes
sealed abstract class Component
case class Quiz (grade:Int) extends Component
// using these classes you can instanciate object lists
val quizzes = List(Quiz(10), Quiz(20), Quiz(30))
// now you can define functions that would work on these lists
def quizMean (l:List[Quiz]):Double = {}
println(quizMean( quizzes))
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
