class Program
{ static void Main(string[] args)
{
// DECLARATIONS
// variables int score = 0; // integer to hold the current score inputted
int game = 1;
/* I know I have to do some kind of looping here for 5 games
* but I'm not sure how to do that!
*/
string numbers = null;
for (int i = 1; i < 5; i++)
{
numbers += i;
numbers += " ";
if (i < 4)
continue;
}
// INPUT
try
{
// Prompt for the score for the current bowler/game
Console.Write("Please enter score for Game {0}: ", game);
score = Convert.ToInt32(Console.ReadLine());
/* Somehow I need to check to make sure the user entered a valid
* number for the score. It's impossible to score a negative
* amount or higher than 300... I need HELP!!! */
if (score >= 301)
Console.Write("Please enter a number under 300 for Game {0}: ", game);
if (score <= -1)
Console.Write("Please enter a number apove 0 for Game {0}: ", game);
}
catch (Exception) // the user's input could not be converted to int
{
// invalid, try again
Console.WriteLine("Error converting your input to a whole number. Please try again.");
}
// PROCESSING
/* Once I get the looping right, I figure I'll be doing some calculations */
// OUTPUT
// Show the bowler score... it should be the average score though....
Console.WriteLine("Average score for Bowler: {0}\n\n, score);
// end of program
Console.Write("\n\nPress any key...");
Console.ReadKey();
}
}
}
Edited by steveosh, 14 October 2010 - 04:23 PM.
it was jumbled


Sign In
Create Account

Back to top









