-
October 10th, 2012, 05:59 AM
#1
Empty console window?
Hello everybody
I am reading a book by Rob miles.
I'm new to programming, entered this code
Code:
using System;
class GlazerCalc
{
static void Main()
{
double width, height, woodLength, glassArea;
string widthString, heightString;
widthString = Console.ReadLine();
width = double.Parse(widthString);
heightString = Console.ReadLine();
height = double.Parse(heightString);
woodLength = 2 * ( width + height ) * 3.25 ;
glassArea = 2 * ( width * height ) ;
Console.WriteLine ( "The length of the wood is " +
woodLength + " feet" ) ;
Console.WriteLine( "The area of the glass is " +
glassArea + " square metres" ) ;
}
}
And when I pressed F5, an empty console window popped up..
What seems to be the problem? Thank you.
-
October 10th, 2012, 01:59 PM
#2
Re: Empty console window?
I only had a quick look at the code, but, could it be that the line
widthString = Console.ReadLine();
is hit, and that the console is simply waiting for some input? (enter some value and press the enter key)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|