jueves, 11 de abril de 2019

Codigo


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int s1,s2,sr;
            int r1,r1,rr;
            int m1,m2,mr;
            int d1,d2,dr;
            int tm1,tm2,tmr;
            int l1,l2,pe,ar;
            int[] FILOSOFIA,MATEMATICAS,INGLES,DIBUJO,TALLER;
            FILOSOFIA = new int [5];
            MATENATICAS = new int [5];
            INGLESN = new int [5];
            DIBUJO = new int [5];
            TALLER = new int [5];
            int c,b;
            string [] NOMBRES;
            NOMBRES = new string [5];       
            int num,a,fact=1;
           int i;                              
           
do {
            Console.Clear();
            Console.WriteLine(“OPCIONES DE CODIGO”);
            Console.WriteLine(“1. SUMA”);
            Console.WriteLine(“2. RESTA”);
            Console.WriteLine(“3. MULTIPLICACION”);  
            Console.WriteLine(“4. DIVISION”);
            Console.WriteLine(“5. TABLAS DE MULTIPLICAR”);
            Console.WriteLine(“6. PERIMETRO Y AREA DE UN RECTANGULO”);
            Console.WriteLine(“7. PROMEDIO”);
            Console.WriteLine(“8. FACTORIAL DE UN NUMERO”);
            Console.WriteLine(“9. SALIR”); 
            Console.WriteLine(“ELIGE UNA OPCION:”);          
            i = Convert.ToInt16(Console.ReadLine());
            Swich (i) {
            case 1:         
                        Console.WriteLine(“SUMA”);    
                        Console.WriteLine(“ESCRIBE EL PRIMER NUMERO”);        
                        s1 = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“ESCRIBE EL NUMEOR DOS”);   
                        s2 = Convert.ToInt16(Console.ReadLine());
                        sr = s1+s2;
                        Console.WriteLine(“{0}+{1}={2}”,s1,s2,sr);       
                        break;
case 2:         
                        Console.WriteLine(“RESTA”);     
                        Console.WriteLine(“ESCRIBE EL PRIMER NUMERO”);         
                        r1 = Convert.ToInt16(Console.ReadLine()); 
                        Console.WriteLine(“ESCRIBE EL NUMEOR DOS”);   
                        r2 = Convert.ToInt16(Console.ReadLine());
                        rr = r1-r2;
                        Console.WriteLine(“{0}-{1}={2}”,r1,r2,rr);         
                        break;
            case 3:         
                        Console.WriteLine(“MULTIOPLICACION”);   
                        Console.WriteLine(“ESCRIBE EL PRIMER NUMERO”);         
                        m1 = Convert.ToInt16(Console.ReadLine());           
                        Console.WriteLine(“ESCRIBE EL NUMEOR DOS”);   
                        m2 = Convert.ToInt16(Console.ReadLine());
                        mr = m1*m2;
                        Console.WriteLine(“{0}x{1}={2}”,m1,m2,mr);
                        break;           
            case 4:         
                        Console.WriteLine(“DIVISION”);           
                        Console.WriteLine(“ESCRIBE EL PRIMER NUMERO”);         
                        d1 = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“ESCRIBE EL SEGUNDO NUMERO”);   
                        d2 = Convert.ToInt16(Console.ReadLine());

                        dr = d1/d2;
                        Console.WriteLine(“{0}/{1}={2}”,d1,d2,dr);    

                        break;
            case 5:
Console.WriteLine(“TABLAS DE MULTIPLICAR”);     
                        Console.WriteLine(“ESCRIBE EL NUMERO DE LA TABLA DE MULTIPLICAR”);   
                        tm1 = Convert.ToInt16(Console.ReadLine());         
                        for (tm2=1; tm2<10; tm2++){
                        tm3=tm1*tm2;
                        Console.WriteLine(“{0}x{1}={2}”,tm1,tm2,tmr);
                        }
                        break;
case 6:

                        l1 = Convert.ToInt16(Console.ReadLine());  
                        Console.WriteLine(“ESCRIBE EL VALOR DE LA ALTURA DEL RECTANGULO”);
                        l2 = Convert.ToInt16(Console.ReadLine());

                        pe=l1+l1+l2+l2;
                        ar=l1*l2*;
                        Console.WriteLine(“EL PERIMETRO DEL RECTANGULO ES {0},pe”);       
                        Console.WriteLine(“EL AREA DEL RECTANGULO ES {0},ar”);
                        break;
            case 7:
                        for (c=0; c<=4; c++)
{
                        Console.WriteLine(“ESCRIBE EL NOMBRE DEL ALUMNO”);          
                        NOMBRE[c] = Convert.String(Console.ReadLine());         
                        FILOSOFIA = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“ESCRIBE LA CALIFICACION DE MATEMATICAS”);
                        MATEMATICAS = Convert.ToInt16(Console.ReadLine());

                        Console.WriteLine(“ESCRIBE LA CALIFICACION DE DIBUJO”);  
                        DIBUJO = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“ESCRIBE LA CALIFICACION DE TALLER”);    
                        TALLER = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“ESCRIBE LA CALIFICACION DE INGLES”);   
                        INGLES = Convert.ToInt16(Console.ReadLine());
                        Console.Clear();
                        }
                        For (c=0; c<=4; c++)
{
                        b = (FOLOSOFIA[c]+MATEMATICAS[c]+DIBUJO[c]+INGLES[c]+TALLER[c])/6;
                        Console.WriteLine(“{0} TIENE UN PROMEDIO FINAL DE {1}”,NOMBRES[c],b);
                        } Console.ReadKey();
                        break;
            case 8:
                        Console.WriteLine(“FACTORIAL DE UN NUMERO”);          

                        Console.WriteLine(“ESCRIBE EL NUMERO A FACTORIZAR”);      
                        num = Convert.ToInt16(Console.ReadLine());
                        Console.WriteLine(“{0}!=”,num);
                        for (a=num; a>0; a--)
{
                        fact = fact*a;
                        Console.WriteLine(a);                  
                        if (a>=2){
                        Console.WriteLine(“x”);  
                        } 
                        }
Console.WriteLine(“ ={0}”,fact”);        
                        Console.ReadLine();
                        break;
                       
default:
                        Console.WriteLine(“DIGITA UNA OPCION VALIDA”);
                        break;       
           
            } Thread.Sleep (1000);
            } While (i != 9);       
}
}
}