Purchase Solution

Write a big-inteter calculator program

Not what you're looking for?

Ask Custom Question

Write a big-inteter calculator program that allows the user to enter two large integers and the operation to be performed and that calls the appropriate function to carry out the designated operation.

Purchase this Solution

Solution Summary

Write a big-inteter calculator program

Solution Preview

Calculator
As a demonstration of how to customize the framework, we present a simple calculator. Here are
the basic commands:
C:PearceJPOPconsole>java Calculator

type "help" for commands
-> help
Console Help Menu:
about: displays application information
help: displays this message
quit: terminate application
ARG1 + ARG2 = sum of ARG1 and ARG2
ARG1 * ARG2 = product of ARG1 and ARG2
ARG1 - ARG2 = difference of ARG1 and ARG2
ARG1 / ARG2 = quotient of ARG1 and ARG2
Note 1: Spaces between tokens are required
Note 2: ARG1 & ARG2 are numbers.
The about command displays information about the framework and the customization:
-> about
Console Framework
copyright (c) 2001, all rights reserved

A Simple Calculator
Copyright (c) 2001, all rights reserved
Of course we can do arithmetic and small errors don't break the calculator:
-> -13 + 51
result = 38.0
-> 12 / 0
Application error, can't divide by 0
-> 13.8 * 3.1416
result = 43.35408
-> x + 2
Application error, ARG1 & ARG2 must be numbers
-> quit
bye
The Console Framework
Design
The console framework provides two classes: Console and AppError. All application-specific errors discovered in the customization are handled by throwing an AppError. The Console class supplies a control loop, and overridable help(), about() , handle(), and execute() methods. In fact, execute() is abstract, ...

Solution provided by:
Education
  • BSc (Hons), University of Colombo - Sri Lanka
  • MEngSc, University of Melbourne
  • Certificate IV in Training & Assessment , Australian Business Council
Recent Feedback
  • "Thank you!"
  • "Thank you."
  • "Thanks a lot for you help and support"
  • "Sorry about the late payment but the assignment was sufficient and appreciated. Good work"
  • "Great description! Thank you for your quick response."
Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Networking Questions

This quiz consists of some basic networking questions.