Dia Mejor

Practica 4.2 Consola

Author: Moises




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practica4_Problema2
{
class Program
{
static void Main(string[] args)
{
int op, no1,no2,no3,no4,no5;
char sigue;
double total = 0.0;




total = 0.0;
do
{
Console.Clear();
Console.WriteLine("\n\t\tProductos Patito");
Console.WriteLine("\n\t\t 1) Producto 1 ..... ($29.80)...... ");
Console.WriteLine("\n\t\t 2) Producto 2 ..... ($45.00)...... ");
Console.WriteLine("\n\t\t 3) Producto 3 ..... ($99.80)...... ");
Console.WriteLine("\n\t\t 4) Producto 4 ..... ($44.90)...... ");
Console.WriteLine("\n\t\t 5) Producto 5 ..... ($68.75)...... ");
Console.Write("\n\t\tSelecciona opcion : ");


op = int.Parse(Console.ReadLine());

switch (op)
{
case 1: Console.SetCursorPosition(55, 3);
no1 = int.Parse(Console.ReadLine());
total = total + no1 * 29.80;
break;
case 2: Console.SetCursorPosition(55, 5);
no2 = int.Parse(Console.ReadLine());
total = total + no2 * 45.00;
break;
case 3: Console.SetCursorPosition(55, 7);
no3 = int.Parse(Console.ReadLine());
total = total + no3 * 99.80;
break;
case 4: Console.SetCursorPosition(55, 9);
no4 = int.Parse(Console.ReadLine());
total = total + no4 * 44.90;
break;
case 5: Console.SetCursorPosition(55, 11);
no5 = int.Parse(Console.ReadLine());
total = total + no5 * 68.75;
break;


default:

Console.WriteLine("Presiono opcion equivocada ");
break;
}
Console.SetCursorPosition(20, 20);
Console.Write("Desea otro producto s/n : ");
sigue = char.Parse(Console.ReadLine());
}
while (sigue == 's' || sigue == 'S');

Console.WriteLine("El total de la compra es: $" + total);
Console.ReadKey();

}
}
}

 

0 Response to “Practica 4.2 Consola”

Leave a Reply