Could anyone tell me if OOP is used much in scientific applications please? I've gotten the impression from some sources that OOP is mainly used in large office and financial app's...
Lurker00
Posts
-
Is OOP used much in scientific applications? -
Errors with book example programNot sure if fiddling about with text to columns would be quicker than a manual delete - I'm thinking the most efficient way to fix this and similar problems might be with an Excel VBA macro?
-
Errors with book example programThanks Stefan! :) (Just noticed all the examples on cd for Day 8 of Sam's C# in 21 Days have the same problem.) On another note, is there a quick and easy way to remove a column of characters, for future reference? (And to fix the rest of the programs quickly.)
-
Errors with book example programIs there an easy way to do that? (It comes out as a big mess if I copy/paste.) The first error is Line 1, Col 2 for some weird reason. I've actually gotten 18 errors.
-
Errors with book example programTrying to run the following console program from a 'Sam's' Learn C# book and getting a bunch of errors; can anyone see what might be causing these please? (I'm only a C# rookie myself.) Error 1 A namespace does not directly contain members such as fields or methods Error 3 Invalid token '7' in class, struct, or interface member declaration Error 4 Invalid token '9' in class, struct, or interface member declaration Error 5 Invalid token '10' in class, struct, or interface member declaration Error 6 Invalid token '11' in class, struct, or interface member declaration Error 7 Invalid token '12' in class, struct, or interface member declaration 1: // Circle1.cs - Overloading the area method 2: //-------------------------------------------------------------------- 3: 4: using System; 5: 6: public class Circle 7: { 8: public int x; 9: public int y; 10: public double radius; 11: private const float PI = 3.14159F; 12: 13: public double Area() // Uses values from data members 14: { 15: return Area(radius); 16: } 17: 18: public double Area( double rad ) 19: { 20: double theArea; 21: theArea = PI * rad * rad; 22: Console.WriteLine(" The area for radius ({0}) is {1}", rad, theArea); 23: return theArea; 24: } 25: 26: public double Area(int x1, int y1, double rad) 27: { 28: return Area(rad); 29: } 30: 31: public double Area( int x1, int y1, int x2, int y2 ) 32: { 33: int x_diff; 34: int y_diff; 35: double rad; 36: 37: x_diff = x2 - x1; 38: y_diff = y2 - y1; 39: 40: rad = (double) Math.Sqrt((x_diff * x_diff) + (y_diff * y_diff)); 41: 42: return Area(rad); 43: } 44: 45: public Circle() 46: { 47: x = 0; 48: y = 0; 49: radius = 0.0; 50: } 51: } 52: 53: class CircleApp 54: { 55: public static void Main() 56: { 57: Circle myCircle = new Circle(); 58: 59: Console.WriteLine("Passing nothing..."); 60: myCircle.Area(); 61: 62: Console.WriteLine("\nPassing a radius of 3..."); 63: myCircle.Area( 3 ); 64: 65: Console.WriteLine("\nPassing a center of (2, 4) and a radius of 3..."); 66: myCircle.Area( 2, 4, 3 ); 67: 68: Console.WriteLine("\nPassing center of (2, 3) and a point of (5, 6)..."); 69: myCircle.Area( 2, 3,
-
Console window question [modified]"If your console app has no ReadLine at the end, and you run it under the IDE, you'll get "Press any key to continue" prompt. [edit]At least in VS2003[/edit]" This must be why my books don't include the readline statement - I'm using the latest version and without the readline the console window behaves the same as in C when you omit the getchar() statement - it briefly flashes and disappears. Presumably they had their reasons for making the change...
-
Console window question [modified]So the fault is the books I'm using then? It just seemed strange to me that two books could have missed the apparent need for such a statement. (I used to use Getchar() in C, but it's not in C#.)
-
Console window question [modified]No this is supposed to run under the MS Visual C# IDE. I have two "step-by-step" type books and both expect the programs to run using the IDE environement; neither seem to consider this problem...
-
Console window question [modified]I'm new to using the Visual C# 2005 Express - is the console window supposed to just flash up and disappear when displaying output from a console program? The book examples I'm using seem to assume so. I've found a code snippet: System.Console.ReadLine(); which does the job, but is it usually necessary to include this line or something similiar to keep the output window from disappearing please? -- modified at 22:31 Saturday 18th November, 2006