Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in C# and i need the code in Visual studio. Please help me in this and make use of list and dictionaries.

I need help in C# and i need the code in Visual studio. Please help me in this and make use of list and dictionaries.

image text in transcribed

image text in transcribed

image text in transcribed

You need to make a dictionary of lists and populate it with four students, and give each of those students three random exam scores between 60 and 100. Your first step should be to play with lists and dictionaries separately to ensure that you get how they work If I have a dictionary of lists named student, then student.someMethod is going to be using methods for dictionaries. Referencing any student name that is a key in that dictionary then means that we are using a list. Studentl"Burkman, Jim"]someMethod is going to be using methods for lists. Iterating through a dictionary of lists will mean that the outer loop is iterating through a dictionary (keyValuePair) and the inner loop will be iterating through a list. How to build: First define the dictionary of lists Then build the data for four sample students * Make up the names, put them in the format LastName, FirstName. * It's a lot like the list of lists example, especially on the right side of the- For the random test scores put the random generator call right in the space for the score Console.WriteLinel$"Jim is (myRandomGeneraor.Next(30,70years old"]; Set up your foreach loop to get the keys from the dictionary, and inside that set up you foreach loop to get the values out of the list associate with the out loop key. Calculate the grade average with the Average method on your dictionarylouterloopKeyl and assign that to a double variable . listOfNumbers.Average() .Round that average off to two decimal places in your WriteLine by using MathRound Console.WriteLinel$"Average: Math.Round(averageOfGrades,2]1') Your output should look like this (numbers and people names will vary): Halpert, Jim exam scores: Average: 74 64 69 89 Beasley, Pam exam scores: Average: 73 66 87 66 Scott, Michael exam scores: Average: 75.67 75 88 64 Schrute, Dwight exam scores Average: 7167 67 87 61 You need to make a dictionary of lists and populate it with four students, and give each of those students three random exam scores between 60 and 100. Your first step should be to play with lists and dictionaries separately to ensure that you get how they work If I have a dictionary of lists named student, then student.someMethod is going to be using methods for dictionaries. Referencing any student name that is a key in that dictionary then means that we are using a list. Studentl"Burkman, Jim"]someMethod is going to be using methods for lists. Iterating through a dictionary of lists will mean that the outer loop is iterating through a dictionary (keyValuePair) and the inner loop will be iterating through a list. How to build: First define the dictionary of lists Then build the data for four sample students * Make up the names, put them in the format LastName, FirstName. * It's a lot like the list of lists example, especially on the right side of the- For the random test scores put the random generator call right in the space for the score Console.WriteLinel$"Jim is (myRandomGeneraor.Next(30,70years old"]; Set up your foreach loop to get the keys from the dictionary, and inside that set up you foreach loop to get the values out of the list associate with the out loop key. Calculate the grade average with the Average method on your dictionarylouterloopKeyl and assign that to a double variable . listOfNumbers.Average() .Round that average off to two decimal places in your WriteLine by using MathRound Console.WriteLinel$"Average: Math.Round(averageOfGrades,2]1') Your output should look like this (numbers and people names will vary): Halpert, Jim exam scores: Average: 74 64 69 89 Beasley, Pam exam scores: Average: 73 66 87 66 Scott, Michael exam scores: Average: 75.67 75 88 64 Schrute, Dwight exam scores Average: 7167 67 87 61

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions