Guest User

Untitled

a guest
Jun 17th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. ##
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace WBLab5_1
  7. {
  8. class lab5Test
  9. {
  10. static void Main(string[] args)
  11. {
  12. lab5Con oTest = new lab5Con();
  13. Console.Write("First Name: ");
  14. String inone = Console.ReadLine();
  15. Console.Write("Last Name: ");
  16. String intwo = Console.ReadLine();
  17.  
  18. String Fullname = (oTest.fixName(inone, intwo));
  19. oTest.MyName = Fullname;
  20. Console.WriteLine(oTest.MyName);
  21. Console.WriteLine(oTest.getString());
  22.  
  23. }
  24. }
  25. }
  26.  
  27. ###
  28. using System;
  29. using System.Collections.Generic;
  30. using System.Text;
  31.  
  32.  
  33. namespace WBLab5_1
  34. {
  35. public abstract class lab5Abb : ILab5
  36. {
  37. public abstract String MyName
  38. {
  39. get;
  40. set;
  41. }
  42.  
  43. protected String CallMe(String inOne, String inTwo)
  44. {
  45. return (inOne + " " + inTwo);
  46. }
  47.  
  48. public static String doNotMuch()
  49. {
  50. return ("Not Much");
  51. }
  52.  
  53. public String getString()
  54. {
  55. return ("getString");
  56. }
  57. }
  58.  
  59. public class lab5Con : lab5Abb
  60. {
  61. String _MyName;
  62.  
  63. public lab5Con()
  64. {
  65. this._MyName = "No Name";
  66. }
  67.  
  68. public lab5Con(String inString)
  69. {
  70. this._MyName = inString;
  71. }
  72.  
  73. public String fixName(String inOne, String inTwo)
  74. {
  75. return (this.CallMe(inOne, inTwo));
  76. }
  77.  
  78. override public string MyName
  79. {
  80. get
  81. {
  82. return this._MyName;
  83. }
  84. set
  85. {
  86. this._MyName = value;
  87. }
  88. }
  89. }
  90. }
  91.  
  92. ##
  93. using System;
  94. using System.Collections.Generic;
  95. using System.Linq;
  96. using System.Text;
  97.  
  98. namespace WBLab5_1
  99. {
  100. public interface ILab5
  101. {
  102. string getString();
  103.  
  104. }
  105.  
  106. }
Add Comment
Please, Sign In to add comment