Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. namespace NumberM {
  3. class InputLocation {
  4. public static void Main (string [] args) {
  5. int PlsCall;
  6. begin:
  7. Console.Write ("Please specify a number : ");
  8. string NumInput = Console.ReadLine ();
  9. int NumNewValue = Int32.Parse (NumInput);
  10. Console.WriteLine("Is {0} the number you specified?", NumNewValue);
  11. string Ans = Console.ReadLine();
  12.  
  13. if (Ans == "yes" || Ans == "Yes") {
  14. Console.WriteLine ("That means {0} is your number. All right. Calculating.");
  15. // disable once SuggestUseVarKeywordEvident
  16. CalcNumb InP = new CalcNumb();
  17. PlsCall = InP.Calculation (NumNewValue);
  18. } else {
  19. Console.WriteLine ("That might be an issue. Taking back.");
  20. goto begin;
  21. }
  22.  
  23. }
  24. }
  25. class CalcNumb {
  26. public int Calculation (int number) {
  27. int Store = number * number;
  28. Console.WriteLine ("This is the square of your number : {0}" , Store);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement