Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started