As requested here is the code for question 1 written in c#. Please feel free to ask any questions.
Employee.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Employee.aspx.cs" Inherits="Employee" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 275px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="1">
<tr>
<td class="auto-style1">Employee Name</td>
<td>
<asp:DropDownList ID="ddlEmployees"
runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td class="auto-style1">Add Brownee Points</td>
<td>
<asp:TextBox ID="txtBrowneePoints"
runat="server"></asp:TextBox>
<%--<asp:RegularExpressionValidator SetFocusOnError="true"
ForeColor="Red" ID="RegularExpressionValidator1"
ControlToValidate="txtBrowneePoints" runat="server"
ErrorMessage="Only Numbers allowed"
ValidationExpression="\d+"></asp:RegularExpressionValidator>--%>
</td>
</tr>
<tr>
<td class="auto-style1">Total Score</td>
<td>
<asp:TextBox ID="txtTotalScore" runat="server"
Enabled="false"></asp:TextBox></td>
</tr>
<tr style="text-align: center;">
<td colspan="2" class="auto-style1">
<asp:Button ID="btnSubmit" runat="server" Text="Submit Score"
OnClick="btnSubmit_Click" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Employee.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Employee : System.Web.UI.Page
{
public class EmployeeDetails
{
public int Id
{
get;
set;
}
public int Points
{
get;
set;
}
public string Name
{
get;
set;
}
}
static List<EmployeeDetails> lstEmployeeDetails = new
List<EmployeeDetails>();
EmployeeDetails employeeDetails = new EmployeeDetails();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Variable for Employee 1
employeeDetails.Id = 1;
employeeDetails.Name = "Employee 1";
employeeDetails.Points = 0;
lstEmployeeDetails.Add(employeeDetails);
//Variable for Employee 2
employeeDetails = new EmployeeDetails();
employeeDetails.Id = 2;
employeeDetails.Name = "Employee 2";
employeeDetails.Points = 0;
lstEmployeeDetails.Add(employeeDetails);
//Variable for Employee 3
employeeDetails = new EmployeeDetails();
employeeDetails.Id = 3;
employeeDetails.Name = "Employee 3";
employeeDetails.Points = 0;
lstEmployeeDetails.Add(employeeDetails);
ddlEmployees.DataSource = lstEmployeeDetails;
ddlEmployees.DataValueField = "id";
ddlEmployees.DataTextField = "Name";
ddlEmployees.DataBind();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
int selectedEmployee =
Convert.ToInt16(ddlEmployees.SelectedValue);
for(int i=0;i<= lstEmployeeDetails.Count-1;i++)
{
if (lstEmployeeDetails[i].Id == selectedEmployee)
{
lstEmployeeDetails[i].Points = lstEmployeeDetails[i].Points +
Convert.ToInt16(txtBrowneePoints.Text);
txtTotalScore.Text =
Convert.ToString(lstEmployeeDetails[i].Points);
break;
}
}
}
}
I need some help with question 1??? Some of it is cut off because I lost...
I have already turned in my HW, I need some understanding of the below SQL queries. 1. Find the number of employees in each department. 2. List the names of departments that have more than 5 employees working there. 3. Retrieve the lowest and highest salary in each department. Output the department name in alphabetical order. Consider the following relational schema. An employee can work in more than on department; also, the percentTime field of the Works relations shows the...
Hello! I'm posting this program that is partially completed if someone can help me out, I will give you a good rating! Thanks, // You are given a partially completed program that creates a list of employees, like employees' record. // Each record has this information: employee's name, supervisors's name, department of the employee, room number. // The struct 'employeeRecord' holds information of one employee. Department is enum type. // An array of structs called 'list' is made to hold...
I only need help for the last question "What Went Wrong?". Thank you! After seeing the problem, your classmate Alice immediately argues that we can apply a linear regression model, as the labels are numbers from 0-9, very similar to the example we learned from Unit 1. Though being a little doubtful, you decide to have a try and start simple by using the raw pixel values of each image as features. Alice wrote a skeleton code run_linear_regression_on_MNIST in main.py,...
I really need your help to answer this question for Tables 1 - 5. Thank you so much I appreciate it!!! For each set of values, determine whether an exponential function is a good model. If so, find the function. If not, explain why. Part C-Linear and Exponential Models (possible 15 points) You can transform an exponential function into a linear function by taking the logarithm of each side. Since linear models are easy to recognize, you can then determine...