Guest User

Untitled

a guest
Feb 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Producto
  8. {
  9. class Datos
  10. {
  11. public string articulo;
  12.  
  13. public string Articulo
  14. {
  15. get { return articulo; }
  16. set { articulo = value; }
  17. }
  18.  
  19.  
  20. public Datos()
  21. {
  22. articulo = "";
  23. }
  24.  
  25. public Datos(string art)
  26. {
  27. articulo = art;
  28. }
  29.  
  30.  
  31.  
  32. #region //Unidad del producto y Desplegar Cantidad
  33. //Unidad del producto
  34. int[] unidadCosto = new int[3];
  35.  
  36. public void Cantidad()
  37. {
  38. int x = 25;
  39. for (int o = 1; o < unidadCosto.Length; o++)
  40. {
  41. int y = 1;
  42. //Cantidad de articulos
  43. Console.ForegroundColor = ConsoleColor.DarkYellow;
  44. Console.SetCursorPosition(x, 1 + o);
  45. Console.Write(" - Cantidad del articulo: ");
  46. Console.ForegroundColor = ConsoleColor.White;
  47. Console.SetCursorPosition(51, y + o);
  48. unidadCosto[o] = int.Parse(Console.ReadLine());
  49. }
  50.  
  51. }
  52.  
  53. public void DesplegarCantidad()
  54. {
  55. for (int o = 1; o < unidadCosto.Length; o++)
  56. {
  57.  
  58. Console.ForegroundColor = ConsoleColor.White;
  59. Console.SetCursorPosition(30, 4 + o);
  60.  
  61. Console.Write(unidadCosto[o]);
  62.  
  63. }
  64. }
  65.  
  66. public void FactorDeCostos()
  67. {
  68. Random rnd = new Random();
  69. int numero;
  70. numero = rnd.Next(5, 16);
  71.  
  72. for (int o = 1; o < unidadCosto.Length; o++)
  73. {
  74.  
  75. Console.ForegroundColor = ConsoleColor.White;
  76. Console.SetCursorPosition(58, 4 + o);
  77. Console.Write((unidadCosto[o] * (numero/100)));
  78. }
  79. }
  80.  
  81.  
  82. //Total de unidad producidas
  83. public void totales()
  84. {
  85. int acumulador = 0;
  86. for(int o = 1; o < unidadCosto.Length; o++)
  87. {
  88. acumulador = acumulador + unidadCosto[o];
  89. }
  90. Console.SetCursorPosition(30, 8);
  91. Console.Write(acumulador);
  92. }
  93.  
  94. #endregion
  95.  
  96. #region //Costo de los Articulos
  97. int[] costoFijo = new int[3];
  98.  
  99. public void CostoArticulo()
  100. {
  101. int xx = 63;
  102. for (int ca = 1; ca < costoFijo.Length; ca++)
  103. {
  104. int yy = 1;
  105. //Costo de los articulos
  106. Console.ForegroundColor = ConsoleColor.DarkYellow;
  107. Console.SetCursorPosition(xx,1 + ca);
  108. Console.Write(" - Costo del articulo: ");
  109. Console.ForegroundColor = ConsoleColor.White;
  110. Console.SetCursorPosition(86, yy + ca);
  111. costoFijo[ca] = int.Parse(Console.ReadLine());
  112. }
  113. }
  114.  
  115. public void DesplegarArticulo()
  116. {
  117. for(int ca = 1; ca < costoFijo.Length; ca++)
  118. {
  119. Console.SetCursorPosition(82, 4 + ca);
  120. Console.Write(costoFijo[ca]);
  121. }
  122. }
  123.  
  124. #endregion
  125.  
  126. }
  127. }
Add Comment
Please, Sign In to add comment