In: Computer Science
1. Start a new Visual Studio project and name it GradeApp
a. Make sure your project is a web project
b. Make sure it is using C#
2. Add a new folder and name it Grades_Logic
3. Inside this new folder create a new web form called “Grades”
4. Add a label to hold text “Enter Grade”
5. Add a text field in front of the label to receive the grade
6. Add another label in a new line to display the text “Participation”
7. Place a drop-down list in front of this label containing the following:
a. Excellent Participant
b. Very Good participant
c. Good participant
d. Fair participant
e. Poor participant
f. Did not participate
8. Add a button in a new line called submit labeled “Submit Evaluation”
9. In a new line below the button add a label to display the output with no text in it
10. Create a code behind to display the final evaluation based on the score entered in the text box and the participation selected from the drop-down list.
11. Final evaluation should be “Excellent”, “Very Good”, “Good”, “Fair”, or “Poor”
12. The logic should work as the following:
a. The grade should present 90% of the total evaluation
b. The participation should be 10% of the total evaluation
i. Excellent Participant = 100% of participation weight
ii. Very Good participant = 90% of participation weight
iii. Good participant = 80% of participation weight
iv. Fair participant = 70% of participation weight
v. Poor participant = 50% of participation weight
vi. Did not participate = 0% of participation weight
13. The final evaluation will be as the following:
a. Excellent = 91% - 100% of total grade
b. Very Good = 81% - 90% of total grade
c. Good = 71% - 80% of total grade
d. Fair = 60% - 70% of total grade
e. Poor is anything below 60% of total grade
Hey, I am pasting the two files here, one is frontend, another is backend. I do not have enough options to send you the Visual Studio project.
Grades.aspx //this file is frontend
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Grades.aspx.cs" Inherits="GradeApp.Grades_Logic.Grades" %>
Grades.aspx.cs //this is backend logic file
using System;
namespace GradeApp.Grades_Logic
{
public partial class Grades : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Evaluate(object sender, EventArgs e)
{
var grades = float.Parse(gradebox.Text);
//90% weight
grades = grades * 0.9f;
var sel =
ddlParticipation.Items[ddlParticipation.SelectedIndex].Value;
float part = 0;
//10% weight
switch(sel)
{
case "Excellent Participant":
part = 10;
break;
case "Very Good participant":
part = 9;
break;
case "Good participant":
part = 8;
break;
case "Fair participant":
part = 7;
break;
case "Poor participant":
part = 5;
break;
case "Did not participate":
part = 0;
break;
}
var finVal = grades + part;
if (finVal >= 91)
final.Text = "Excellent";
else if (finVal >= 81)
final.Text = "Very Good";
else if (finVal >= 71)
final.Text = "Good";
else if (finVal >= 60)
final.Text = "Fair";
else
final.Text = "Poor";
}
}
}