Question

Create a C# program that will first prompt the instructors to enter the number of students...

Create a C# program that will first prompt the instructors to enter the number of students they currently have in their classes. Use this value for the size of the row dimension of your multidimensional array.

Next, prompt the instructors to type in the number of scores they would like to enter. This variable will be used to designate the column size dimension of your multidimensional array.

Then, use a loop to prompt the user to enter the number of scores they specified for each student listed in the first prompt. This means if the user entered 2 for the first prompt and 10 for the second prompt, you would prompt the instructor a total of 20 times. Make sure you label the student number in your prompt, similar to the example below.

You could say "Enter Student 1 Score" and the second prompt would be

"Enter Student 1 Score," and so on.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C# Program:

using System.IO;
using System;

class Program
{
    static void Main()
    {
        int students, scores;
      
        //Reading number of students - row
        Console.Write("\n Input number of students: ");
        students = Convert.ToInt32(Console.ReadLine());
      
        //Reading number of scores - column
        Console.Write("\n Input number of scores: ");
        scores = Convert.ToInt32(Console.ReadLine());
      
        //Array to hold studentScores
        int[,] studentScores = new int[students,scores];
      
        Console.WriteLine();
      
        //Reading scores from user
        for(int i=0; i<students; i++)
        {
            for(int j=0; j<scores; j++)
            {
                //Prompting user for score
                Console.Write(" Enter Student " + (i+1) + " Score " + (j+1) + ": ");
              
                //Reading and storing in array
                studentScores[i,j] = Convert.ToInt32(Console.ReadLine());
            }
          
            Console.WriteLine();
        }
      
          
        Console.WriteLine("\n\n Student Scores are: \n");
        Console.WriteLine("\n Student \t\t Scores \n");
      
        //Iterating over students
        for(int i=0; i<students; i++)
        {
            //Prompting user for score
                Console.Write("\n   " + (i+1) + " \t\t ");
              
            //Itreating over scores
            for(int j=0; j<scores; j++)
            {
                //Prompting user for score
                Console.Write(" " + studentScores[i,j]);
            }
        }
      
        Console.WriteLine();
    }
}


___________________________________________________________________________________________

Sample Output:

Add a comment
Know the answer?
Add Answer to:
Create a C# program that will first prompt the instructors to enter the number of students...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program that asks user number of students in a class and their names....

    Write a C++ program that asks user number of students in a class and their names. Number of students are limited to 100 maximum. Then, it will ask for 3 test scores of each student. The program will calculate the average of test scores for each student and display with their names. Then, it will sort the averages in descending order and display the sorted list with students’ names and ranking. Follow the Steps Below Save the project as A4_StudentRanking_yourname....

  • Write a program that determines how many terms 10 students need to graduate. Step 1. Create...

    Write a program that determines how many terms 10 students need to graduate. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse and ensure the following steps are accomplished. 1.  Define a two-dimension array with 10 rows and 2 columns. 2.  Prompt the user to enter the number of courses they have left to graduate (value must be between 1...

  • Write a program that allows the user to enter a series of exam scores. The number...

    Write a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop...

  • Create a C++ program to calculate grades as well as descriptive statistics for a set of...

    Create a C++ program to calculate grades as well as descriptive statistics for a set of test scores. The test scores can be entered via a user prompt or through an external file. For each student, you need to provide a student name (string) and a test score (float). The program will do the followings: Assign a grade (A, B, C, D, or F) based on a student’s test score. Display the grade roster as shown below: Name      Test Score    ...

  • In Java Main method Your main program will prompt the user for a test name and...

    In Java Main method Your main program will prompt the user for a test name and the number of scores the user will enter. After creating an arraylist to hold the scores, prompt the user for all the scores to hold in the arraylist. After all the scores are entered, then repeat back the score & letter grade. GradeBook Object Create an instance of a GradeBook object and pass the test name and arraylist to set the instance variables. At...

  • Write a program that determines how many terms 10 students need to graduate. Step 1. Create...

    Write a program that determines how many terms 10 students need to graduate. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse and ensure the following steps are accomplished. 1.  Define a two-dimension array with 10 rows and 2 columns. 2.  Prompt the user to enter the number of courses they have left to graduate (value must be between 1...

  • using java Program: Please read the complete prompt before going into coding. Write a program that...

    using java Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...

  • java programe Write a program that prompts the user to enter in an integer number representing...

    java programe Write a program that prompts the user to enter in an integer number representing the number of elements in an integer array. Create the array and prompt the user to enter in values for each element using a for loop. When the array is full, display the following: The values in the array on a single line. The array with all of the elements reversed. The values from the array that have even numbered values. The values from...

  • C++ Program Write a do-while loop that continues to prompt a user to enter a number...

    C++ Program Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is: Enter a number (<100): Enter a number (<100): Enter a number (<100): Your number < 100 is: 25 #include <iostream> using namespace std; int main() { int userInput; /* Your solution goes here */...

  • Must be done in C# please! Thanks! In this assignment you will create a program named...

    Must be done in C# please! Thanks! In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT