O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

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

Making the Calculator More General with a “Little Language”

You need to make a little change to the user interface of the calculator, to make it more “testable.”

User Interface

The part of the program that sends output to the user and gets input from the user.

Instead of prompting users to input numbers or indicate that they want to stop, the program will now get commands from a “little language.” These commands will be typed into the running program when it needs input—just as you type on your handheld calculator.

A statement in this language has the following form:

<operator><operand>

<operator> can be any of the following:

+ to add the operand ...

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