Calculator

Line: Forms Line
Medium Difficulty Forms Learning Outcome One Learning Outcome Two Learning Outcome Six Exercise
Type: Exercise
You should have completed: Hello World of Windows This topic leads to: Timing App

Summary

A windows application with a moderate level of complexity, a simple calculator should prove to be an educational exercise.

Task

  1. Create a Windows Forms application
  2. Using the form designer, create an interface for a simple calculator, including controls for the numbers 0-9, and basic maths functions + - / and *, as well as = to give the final result. You may wish to have a single control to display the result and show user input, or have separate controls for those functions.
  3. Use the events on those controls to add methods which will produce the behaviour of a physical calculator.
  4. Fully test your program.

Questions

  1. Can you modify your calculator to have a 'memory' functionality: Memory add, memory clear, memory recall?
  2. Can the user type a number directly into your calculator using the keyboard and have it work? If not, can you make it support this kind of entry?