jhylands

jun2010 comp1 practical code

May 9th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.71 KB | None | 0 0
  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Dim PlayerOneScore As Integer = 0
  5.         Dim PlayerTwoScore As Integer = 0
  6.         Console.WriteLine("How many games?")
  7.         Dim NoOfGamesInMatch As Integer
  8.         NoOfGamesInMatch = Console.ReadLine()
  9.         For NoOfGamesPlayed = 1 To NoOfGamesInMatch
  10.             Console.WriteLine("Did player One win the game (enter Y or N)?")
  11.             If Console.ReadLine() = "Y" Then
  12.                 PlayerOneScore = PlayerOneScore + 1
  13.             Else
  14.                 PlayerTwoScore = PlayerTwoScore + 1
  15.             End If
  16.         Next
  17.         Console.WriteLine(PlayerOneScore)
  18.         Console.WriteLine(PlayerTwoScore)
  19.         Console.Read()
  20.     End Sub
  21.  
  22. End Module
Advertisement
Add Comment
Please, Sign In to add comment