Question

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;

If one of the radio buttons Find midterm or Final final score of a student is selected, determine which combo box item (w

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

Solution:

STEP by Step Procedure:

Code For frmTestAverage

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Test_Scores
{
public partial class frmTestAverage : Form
{

public static int[,] Grades = new int[10, 3]{
{897,88,78},{ 242,75,80},{301,94,92},{987,70,81},{116,90,93},{450,87,77},{865,81,75},{128,79,88},{992,97,76},{109,79,85}
};

public static double Averageofall,AverageofMid,AverageofFinal,Studentmid,studentfinal;

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
label2.Text = "";
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
label2.Text = "";
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
label2.Text = "";
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
label2.Text = "";
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
label2.Text = "";
}

public frmTestAverage()
{
InitializeComponent();
}

private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
label2.Text = "";

}

private void frmTestAverage_Load(object sender, EventArgs e)
{
radioButton1.Checked = true;
for (int i = 0; i < Grades.GetLength(0); i++)
{
comboBox1.Items.Add(new { Text = Grades[i, 0], Key = Grades[i, 0] });
}
comboBox1.DisplayMember = "Text";
comboBox1.ValueMember = "Key";
comboBox1.SelectedIndex = 0;


}

private void btnDisplay_Click(object sender, EventArgs e)
{
  
if (radioButton1.Checked==true)
{
for (int i = 0; i < Grades.GetLength(0); i++)
{
double Averageofarow = (Grades[i, 1] + Grades[i, 2]) / 2;
Averageofall = Averageofall + Averageofarow;

}

label2.Text = Convert.ToString(Averageofall/10);
}
else if(radioButton2.Checked == true)
{
for (int i = 0; i < Grades.GetLength(0); i++)
{
AverageofMid = AverageofMid + Grades[i, 1];
}
AverageofMid = AverageofMid / 10;
label2.Text = Convert.ToString(AverageofMid);
}
else if (radioButton3.Checked == true)
{
for (int i = 0; i < Grades.GetLength(0); i++)
{
AverageofFinal = AverageofFinal + Grades[i, 2];
}
AverageofFinal = AverageofFinal / 10;
label2.Text = Convert.ToString(AverageofFinal);
}
else if(radioButton4.Checked == true)
{
if (comboBox1.SelectedIndex != 0)
{

Studentmid = Grades[comboBox1.SelectedIndex - 1, 1];
label2.Text = Studentmid.ToString();
  
}
else
{
MessageBox.Show("Please select a student");
}
}
else if (radioButton5.Checked == true)
{
if (comboBox1.SelectedIndex != 0)
{

studentfinal = Grades[comboBox1.SelectedIndex - 1, 2];
label2.Text = studentfinal.ToString();

}
else
{
MessageBox.Show("Please select a student");
}
}
}
}
}

CODE IN EDITOR

OUTPUT

1.

2.

3.

4.

5.

6.

...If you have any further doubts please ask me through comment box...

Add a comment
Know the answer?
Add Answer to:
Must be done in C# please! Thanks! In this assignment you will create a program named...
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
  • Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME,...

    Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME, as specified by the prompt! DO NOT use user input of 1, 2, 3 etc. User input must come from clicking the buttons. Please be sure to test your program. Thank you! Write a program that displays three buttons with the names or images of three candidates for public of office. Imagine that a person votes by clicking the button that shows the candidate...

  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...

  • CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes...

    CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes the user and displays the purpose of the program. It then prompts the user to enter the name of an input file (such as scores.txt). Assume the file contains the scores of the final exams; each score is preceded by a 5 characters student id. Create the input file: copy and paste the following data into a new text file named scores.txt DH232 89...

  • 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...

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • Problem Statement You are to create a Visual Basic(VB) project for a census bureau to obtain...

    Problem Statement You are to create a Visual Basic(VB) project for a census bureau to obtain and analyze household income survey data within the Pittsburgh   area (including Morgantown Ky). Data Collected: Home identification code (4 alphanumeric characters) – required Program should generate it using a random number generator. You won’t use this anywhere it just need to be generated. Generate the first number in the Form Load event and then each subsequent number in the button click. See attached code...

  • In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a tes...

    In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a test grade (integer value) for each student in a class. Validation Tests are graded on a 100 point scale with a 5 point bonus question. So a valid grade should be 0 through 105, inclusive. Processing Your program should work for any...

  • have to create five different functions above and call it in the main fucntion. Project Exam...

    have to create five different functions above and call it in the main fucntion. Project Exam Statistics A CIS 22A class has two midterm exams with a score between 0 and 100 each. Fractional scores, such as 88.3 are not allowed. The students' ids and midterm exam scores are stored in a text file as shown below // id exam1 exam2 DH232 89 92 Write a program that reads data from an input file named exams.txt, calculates the average of...

  • in C++ please ELET 2300 Programming Assignment # 2 Write a program that generates an array...

    in C++ please ELET 2300 Programming Assignment # 2 Write a program that generates an array filled up with random positive integer number ranging from 15 to 20, and display it on the screen. After the creation and displaying of the array, the program displays the following: [P]osition [Reverse, [A]verage, (Search, [Q]uit Please select an option: Then, if the user selects: -P (lowercase or uppercase): the program displays the array elements position and value pairs for all member elements of...

  • C++ Programming

    PROGRAM DESCRIPTIONIn this project, you have to write a C++ program to keep track of grades of students using structures and files.You are provided a data file named student.dat. Open the file to view it. Keep a backup of this file all the time since you will be editing this file in the program and may lose the content.The file has multiple rows—each row represents a student. The data items are in order: last name, first name including any middle...

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