Vous êtes sur la page 1sur 5

ARCHIVO CSS PARA LOS EJEMPLOS DE REPASO:

body {

background:black; color:White; font-family:Garamond;

} hr { } p {

color:red;

font-family:Garamond; }

Ejemplo 1:
Crear una pgina ASP.NET que determine el impuesto local dado al ingreso. La regla es: el 5% de la parte del ingreso que exceda de $1000. (Suponga que el ingreso es cuando menos de $1000.)

CODIGO
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <link rel="stylesheet" href="StyleSheet.css" /> <title>Ejercicio 4</title> </head> <body> <script runat="server"> Sub impuestos(ByVal sender As Object, ByVal e As EventArgs) Dim va, im, total As Double va = Val.Text If va < 1000 Then valor.Text = va impuesto.Text = "no tiene retencion por se menor a $1000 su ingreso" Else im = (va - 1000) * 0.05 total = va + im valor.Text = va impuesto.Text = "El impuesto es de: " & im End If End Sub </script> <center> <h1>Ejercicio 4 Guia 2. 4</h1> <p>Crear una pgina ASP.NET que determine el impuesto local dado al ingreso. La regla es: el 5% de la parte del ingreso que exceda de $1000. <br />(Suponga que el ingreso es cuando menos de $1000.)</p> <form id="form1" runat="server"> <div> CALCULO DE INTERES <hr/> <p> Introdusca el valor de su ingreso</p> Aos : <asp:TextBox ID="val" runat="server" size="10"></asp:TextBox> <br /><br /><br /> <asp:Button ID="Calcular" runat="server" OnClick="impuestos" Text="Calcular" /> <hr/> <p>su ingreso es :</p> <asp:Label ID="valor" runat="server"></asp:Label><br />

<asp:Label ID="impuesto" runat="server"></asp:Label><br /> <hr/> </div> </form> </center> </body> </html>

PANTALLA:

Ejemplo 2:
Utilizando los controles RadioButtonList necesarios crear una pagina que permita calcular el salario mensual de un obrero tomando en cuenta que el obrero trabaja 6 das por semana y 8 horas diarias con un costo por hora de $8.00.

CODIGO
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Ejer2Guia3.aspx.vb" Inherits="Ejer2Guia3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Label1.Text = Format((RadioButtonList1.SelectedIndex + 1) * 8 * 8, "$0.00") End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <link rel="stylesheet" href="StyleSheet.css" /> <title>Pgina sin ttulo</title> </head> <body> <center> <form id="form1" runat="server"> <div> <span>CALCULO DE SALARIO</span> <p> <span>Das trabajados en la semana:</span></p> <p> <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem>1 da</asp:ListItem> <asp:ListItem>2 das</asp:ListItem> <asp:ListItem>3 das</asp:ListItem> <asp:ListItem>4 das</asp:ListItem> <asp:ListItem>5 das</asp:ListItem> <asp:ListItem>6 das</asp:ListItem> </asp:RadioButtonList> </p> <p> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Calcular" style="height: 26px" /> </p> <p> <span lang="es-sv">Salario de la semana: <asp:Label ID="Label1" runat="server"></asp:Label> </span> </p>

</div> </form> </center> </body> </html>

PANTALLA:

Vous aimerez peut-être aussi