Question

write your best answer on the providedpever veurbest vi When creating a procedure just write something 1. Imagine you are a manager of three consultants and vouwant to keep arunning total of their value to You need a form where you can add brownie points to their running total when they have done somethin points from the n they error that has dropdown ispre loa write a web form companys three employees names (text field) and value field. a textbox wherein you can type in a textbox for output create one variable for each employee. write the that can take the employee chosen in the dropdownlist, and give them more brow points based on the number typed to textbox 5the employee loses 5 points if you ty employee gains 5 points. you type-5 of each employees value on separate After each transaction write the status Write the procedure that can clear the form for the next data entry. Be careful not to cear the runn hree employees (5 points). A hotels website has two calendar controls on a form (or two textbox controls that show calendars ate and one for checkout date, a button and an output textbox. The hotel charges $35 per day. writ e textbox that reflects the cost of the hotel stay depending on how many days were selected in the ints). write any quick Select Case coding example (no error checking needed) that shows your mastery nts). Not a full procedure, rather a code segment that makes sense. Save time for the last proble magine you are using an ASP.NET webform to book optional tours at a resort in Thailand. Imagin kboxlist of optional tours and their prices. You received a request from a high-roller customer s of all the optional tours. Dont worry about the specific names and prices, the list is pre-load the procedure that can loop the items collection of the checkboxlist, and build a string varia rices of the optional tours. output this string variable to a textbox. (30 points). I need some help with question 1??? Some of it is cut off because I lost the paper but can you please help me with what you can see for question 1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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;
}
}
  
}
}

Add a comment
Know the answer?
Add Answer to:
I need some help with question 1??? Some of it is cut off because I lost...
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
  • I have already turned in my HW, I need some understanding of the below SQL queries....

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

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

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

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

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