Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
- 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
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