PrimerProgramaClase3

Run Settings
LanguageC#
Language Version
Run Command
using System; class MainClass { static void Main() { //String s = Console.ReadLine(); //ingresando el valor de s String s = "Valor de s"; Console.WriteLine("Hello World!"); Rafael rafael = new Rafael(); Console.WriteLine(rafael.EnviarNombre()); Console.WriteLine("Agregar1"); rafael.Agregar1();rafael.Agregar1(); rafael.Agregar1(); Console.WriteLine("Despues de agregar1:" +rafael.Cantidad); //agregando una coordenada de la migaja rafael.co.Add(new Rafael.Coordenadas(6,5,"hola")); } }
using System; using System.Collections.Generic; public class Rafael{ String Apellido; String Nombre; public List<Coordenadas> co = new List<Coordenadas>(); public int Cantidad; public Rafael(){ Apellido = "Zelaya"; Nombre = "Rafael"; Cantidad = 0; } public String EnviarNombre(){ return Nombre + " " + Apellido; } public void Agregar1(){ Cantidad++; } public struct Coordenadas{ String Nombre; int x,y; public Coordenadas(int a, int b, String nombre){ x = a; y = b; Nombre = nombre; } } }
Editor Settings
Theme
Key bindings
Full width
Lines