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 ...

Get C# Primer Plus now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.