Question: In Swift language Write a class called MarksTable that uses generics. Implement the following in this class: Use Dictionary to store student names and their

In Swift language Write a class called MarksTable that uses generics.

  1. Implement the following in this class:
  • Use Dictionary to store student names and their marks. Names should be a String key and the mark should be generic.
  • Include an append method that takes a tuple including name and mark as a parameter. Add this student and their mark to the Dictionary
  • include a subscript method that provides both get and set functionality
  • include a display method that loops through Dictionary and displays each student and their mark as follows:

Bobo has a mark of 35

Jason has a mark of 98

Ron has a mark of 98

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!