jueves, 17 de septiembre de 2009

Practica 5

Consola
using System;
using System.Collections.Generic;
using System.Text;
namespace Practica_5_Consola
{
class Program
{
static void Main(string[] args)
{
double costoAuto, costototal;
Console.WriteLine("Introduce Costo del Aauto");
costoAuto = double.Parse(Console.ReadLine());
double ganancia = costoAuto * 0.12;
double impuesto = costoAuto * 0.06;
costototal = costoAuto + ganancia + impuesto;
Console.WriteLine(" Costo del Aauto . . . = {0}\n Ganancia del Vendedro = {1}\n Impuesto = {2}\n Costo Total = {3}", costoAuto, ganancia, impuesto, costototal);
Console.ReadKey() } }}






Windows.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;using System.Text;

using System.Windows.Forms;
namespace Practica_5_Windows

{

public partial class Form1 : Form

{

double Costtotal, costo;

public Form1()

{

InitializeComponent();

Costtotal = costo = 0;

}
private void CALCULAR_Click(object sender, EventArgs e)

{

costo = double.Parse(textBox1.Text);

Costtotal = costo + costo * 0.12 + costo * 0.06;

textBox2.Text = Costtotal.ToString();

private void CLEAR_Click(object sender, EventArgs e)

{


}

textBox1.Clear();

textBox2.Clear();

textBox1.Focus(); }
private void CLOSE_Click(object sender, EventArgs e)

{

Close(); } }}

No hay comentarios: