Question

GUI Program Development Activity (C#) You are required to demonstrate the four-stage process of program development:...

GUI Program Development Activity (C#)

You are required to demonstrate the four-stage process of program development: analysis, design, implementation and testing and as such your service is retained as a business analysis to design a simple student grade program. The program should achieve the following objectives:

1. Design an interface and implement the following.

2. Records the students name.

3. Accepts 7 test scores for the student.

4. Calculates the sum of the scores.

5. Calculates the average of the scores calculated.

6. Displays the test scores.

7. Displays the average of the test scores.

Your deliverables are: A. Submit a screen capture and code

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

In case of any query do comment. Please rate answer as well. Thanks

Note: Assumed that user will provide all the input in correct values as this was code question so just to keep it simple no Validations are added for Grades.

Code:

====Form1.cs===

using System;
using System.Windows.Forms;

namespace StudentGradeForm
{
public partial class Form1 : Form
{   

public Form1()
{
InitializeComponent();
}

/// <summary>
/// Handles button Calculate Sum
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnCalculateSum_Click(object sender, EventArgs e)
{
//calculate sum and display the output   
lblSum.Text = $"The Sum of the reocrds for student { txtName.Text} are {CalculateSum()}";
}

/// <summary>
/// Handles button Calculate Average
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnCalculateAverage_Click(object sender, EventArgs e)
{
//first calulate the sum and then average and display the output
int sum = CalculateSum();
double average = sum / 7.0;
lblAverage.Text = string.Format("The Average of the reocrds for student {0} are {1:C}",txtName.Text,average);
}

/// <summary>
/// to calculate the sum of all the grades
/// </summary>
/// <returns></returns>
private int CalculateSum()
{
return int.Parse(txtGrade1.Text) + int.Parse(txtGrade2.Text) + int.Parse(txtGrade3.Text) +
int.Parse(txtGrade4.Text) + int.Parse(txtGrade5.Text) + int.Parse(txtGrade6.Text) + int.Parse(txtGrade7.Text);
}
}
}

====form1.Designer.cs=====

namespace StudentGradeForm
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.txtGrade1 = new System.Windows.Forms.TextBox();
this.txtGrade2 = new System.Windows.Forms.TextBox();
this.txtGrade3 = new System.Windows.Forms.TextBox();
this.txtGrade4 = new System.Windows.Forms.TextBox();
this.txtGrade5 = new System.Windows.Forms.TextBox();
this.txtGrade6 = new System.Windows.Forms.TextBox();
this.txtGrade7 = new System.Windows.Forms.TextBox();
this.btnCalculateSum = new System.Windows.Forms.Button();
this.btnCalculateAverage = new System.Windows.Forms.Button();
this.lblSum = new System.Windows.Forms.Label();
this.lblAverage = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(51, 47);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(75, 13);
this.label1.TabIndex = 0;
this.label1.Text = "StudentName:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(81, 77);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(45, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Grade1:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(81, 99);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(45, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Grade2:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(81, 125);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(45, 13);
this.label4.TabIndex = 3;
this.label4.Text = "Grade3:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(81, 151);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(45, 13);
this.label5.TabIndex = 4;
this.label5.Text = "Grade4:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(81, 177);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(45, 13);
this.label6.TabIndex = 5;
this.label6.Text = "Grade5:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(81, 209);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(45, 13);
this.label7.TabIndex = 6;
this.label7.Text = "Grade6:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(81, 235);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(45, 13);
this.label8.TabIndex = 7;
this.label8.Text = "Grade7:";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(132, 44);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(136, 20);
this.txtName.TabIndex = 8;
//
// txtGrade1
//
this.txtGrade1.Location = new System.Drawing.Point(132, 70);
this.txtGrade1.Name = "txtGrade1";
this.txtGrade1.Size = new System.Drawing.Size(136, 20);
this.txtGrade1.TabIndex = 9;
//
// txtGrade2
//
this.txtGrade2.Location = new System.Drawing.Point(132, 96);
this.txtGrade2.Name = "txtGrade2";
this.txtGrade2.Size = new System.Drawing.Size(136, 20);
this.txtGrade2.TabIndex = 10;
//
// txtGrade3
//
this.txtGrade3.Location = new System.Drawing.Point(132, 122);
this.txtGrade3.Name = "txtGrade3";
this.txtGrade3.Size = new System.Drawing.Size(136, 20);
this.txtGrade3.TabIndex = 11;
//
// txtGrade4
//
this.txtGrade4.Location = new System.Drawing.Point(132, 148);
this.txtGrade4.Name = "txtGrade4";
this.txtGrade4.Size = new System.Drawing.Size(136, 20);
this.txtGrade4.TabIndex = 12;
//
// txtGrade5
//
this.txtGrade5.Location = new System.Drawing.Point(132, 174);
this.txtGrade5.Name = "txtGrade5";
this.txtGrade5.Size = new System.Drawing.Size(136, 20);
this.txtGrade5.TabIndex = 13;
//
// txtGrade6
//
this.txtGrade6.Location = new System.Drawing.Point(132, 206);
this.txtGrade6.Name = "txtGrade6";
this.txtGrade6.Size = new System.Drawing.Size(136, 20);
this.txtGrade6.TabIndex = 14;
//
// txtGrade7
//
this.txtGrade7.Location = new System.Drawing.Point(132, 232);
this.txtGrade7.Name = "txtGrade7";
this.txtGrade7.Size = new System.Drawing.Size(136, 20);
this.txtGrade7.TabIndex = 15;
//
// btnCalculateSum
//
this.btnCalculateSum.Location = new System.Drawing.Point(26, 313);
this.btnCalculateSum.Name = "btnCalculateSum";
this.btnCalculateSum.Size = new System.Drawing.Size(115, 37);
this.btnCalculateSum.TabIndex = 16;
this.btnCalculateSum.Text = "Calculate/Display Sum";
this.btnCalculateSum.UseVisualStyleBackColor = true;
this.btnCalculateSum.Click += new System.EventHandler(this.btnCalculateSum_Click);
//
// btnCalculateAverage
//
this.btnCalculateAverage.Location = new System.Drawing.Point(147, 313);
this.btnCalculateAverage.Name = "btnCalculateAverage";
this.btnCalculateAverage.Size = new System.Drawing.Size(121, 37);
this.btnCalculateAverage.TabIndex = 17;
this.btnCalculateAverage.Text = "Calculate/Display Average";
this.btnCalculateAverage.UseVisualStyleBackColor = true;
this.btnCalculateAverage.Click += new System.EventHandler(this.btnCalculateAverage_Click);
//
// lblSum
//
this.lblSum.AutoSize = true;
this.lblSum.Location = new System.Drawing.Point(91, 260);
this.lblSum.Name = "lblSum";
this.lblSum.Size = new System.Drawing.Size(0, 13);
this.lblSum.TabIndex = 20;
//
// lblAverage
//
this.lblAverage.AutoSize = true;
this.lblAverage.Location = new System.Drawing.Point(81, 285);
this.lblAverage.Name = "lblAverage";
this.lblAverage.Size = new System.Drawing.Size(0, 13);
this.lblAverage.TabIndex = 21;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(445, 450);
this.Controls.Add(this.lblAverage);
this.Controls.Add(this.lblSum);
this.Controls.Add(this.btnCalculateAverage);
this.Controls.Add(this.btnCalculateSum);
this.Controls.Add(this.txtGrade7);
this.Controls.Add(this.txtGrade6);
this.Controls.Add(this.txtGrade5);
this.Controls.Add(this.txtGrade4);
this.Controls.Add(this.txtGrade3);
this.Controls.Add(this.txtGrade2);
this.Controls.Add(this.txtGrade1);
this.Controls.Add(this.txtName);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Student Grade";
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtGrade1;
private System.Windows.Forms.TextBox txtGrade2;
private System.Windows.Forms.TextBox txtGrade3;
private System.Windows.Forms.TextBox txtGrade4;
private System.Windows.Forms.TextBox txtGrade5;
private System.Windows.Forms.TextBox txtGrade6;
private System.Windows.Forms.TextBox txtGrade7;
private System.Windows.Forms.Button btnCalculateSum;
private System.Windows.Forms.Button btnCalculateAverage;
private System.Windows.Forms.Label lblSum;
private System.Windows.Forms.Label lblAverage;
}
}

=========screen shot of the code=======

output:

Add a comment
Know the answer?
Add Answer to:
GUI Program Development Activity (C#) You are required to demonstrate the four-stage process of program development:...
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
  • CSC151 Stock Portfolio GUI Project Goal You are to write a GUI program that will allow...

    CSC151 Stock Portfolio GUI Project Goal You are to write a GUI program that will allow a user to buy, sell and view stocks in a stock portfolio. This document will describe the minimum expected functions for a grade of 90. Your mission is to “go and do better.” You’ll find a list of enhancement options at the end of this document. Objectives By the end of this project, the student will be able to • write a GUI program...

  • In this homework, you will design a program to perform the following task: Write a program...

    In this homework, you will design a program to perform the following task: Write a program that would allow a user to enter student names and Final grades (e.g. A,B,C,D,F) from their courses. You do not know how many students need to be entered. You also do not know how many courses each of the students completed. Design your program to calculate the Grade Point Average (GPA) for each student based on each of their final grades. The program should...

  • CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50...

    CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50 Points) Please do the following exercises: Pastoral College is a small college in the Midwest. Design the pseudo-code for a program that accepts a student name, major field of study, and grade point average. Display a student’s data with the message “Dean’s list” if the student’s grade point average is above 3.5, “Academic probation” if the grade point average is below 2.0, and no...

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

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

  • Instructions: Consider the following C++ program. At the top you can see the interface for the...

    Instructions: Consider the following C++ program. At the top you can see the interface for the Student class. Below this is the implementation of the Student class methods. Finally, we have a very small main program. #include <string> #include <fstream> #include <iostream> using namespace std; class Student { public: Student(); Student(const Student & student); ~Student(); void Set(const int uaid, const string name, const float gpa); void Get(int & uaid, string & name, float & gpa) const; void Print() const; void...

  • In this assignment, you will write a program in C++ which uses files and nested loops...

    In this assignment, you will write a program in C++ which uses files and nested loops to create a file from the quiz grades entered by the user, then reads the grades from the file and calculates each student’s average grade and the average quiz grade for the class. Each student takes 6 quizzes (unknown number of students). Use a nested loop to write each student’s quiz grades to a file. Then read the data from the file in order...

  • Please Write in C++ (10-30) @ 11:55pm 1.9 HW7 This homework assignment gives you the opportunity...

    Please Write in C++ (10-30) @ 11:55pm 1.9 HW7 This homework assignment gives you the opportunity to practice functions, functions that call other functions, reference variables, logical statements (what is meant by logical statement is a statement such as if, if/else if, switch), and input validation, HW7 (Graded out of 100) A talent competition has 5 judges, each of whom awards a score between 0 and 10 for each performer. Fractional scores, such as 8.3, are allowed. A performer's final...

  • import java.util.*; /** Description: This program determines the average of a list of (nonnegative) exam scores....

    import java.util.*; /** Description: This program determines the average of a list of (nonnegative) exam scores. Repeats for more exams until the user says to stop. Input: Numbers, sum, answer Output: Displays program description Displays instruction for user Displays average Algorithm: 1. START 2. Declare variables sum, numberOf Students, nextNumber, answer 3. Display welcome message and program description 4. DOWHILE user wants to continue 5. Display instructions on how to use the program 6. Inititalize sum and number of student...

  • In C++ Write a menu driven C++ program to read a file containing information for a list of Students, process the data, t...

    In C++ Write a menu driven C++ program to read a file containing information for a list of Students, process the data, then present a menu to the user, and at the end print a final report shown below. You may(should) use the structures you developed for the previous assignment to make it easier to complete this assignment, but it is not required. Required Menu Operations are: Read Students’ data from a file to update the list (refer to sample...

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