O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Essential Elements of SimpleCalculator.cs

You have already met the string type in Chapter 3, “A Guided Tour through C#: Part I.” The calculator program you will see shortly introduces another type called int, which is a commonly used type for variables holding whole numbers. You will further see how you can define and use your own methods. The important namespace concept, enabling classes and other types to be organized into a single coherent hierarchical structure while providing easy access, is also presented. WriteLine will show off by revealing its versatility, and you will finally meet the handy Math class and apply a couple of methods from this part of the .NET Framework class library.

Presenting SimpleCalculator.cs

The source code in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required