Skip to content

Angie-Sala/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Calculator Application

Overview

This Java application is a simple calculator that performs basic arithmetic operations and includes additional functionalities such as decimal input, clearing the display, deleting the last character, and more. It provides both GUI interaction and keyboard support for ease of use.

Features

Basic Functions Addiction (+) Subtraction (-) Multiplication (*) Division (/)

Additional Functions Decimal point (.) Clear display (clr) Delete last character (⌫) Negate current number (-) Compute result (=)

User Interface Text Field: Displays input and output. Operation Label: Shows the current operation. Number Buttons: 0-9 for numeric input. Function Buttons: +, -, *, /, ., clr, ⌫, (-), and = for actions.

Keyboard Support Numeric input via keyboard. Arithmetic operations (+, -, *, /) directly from keyboard. Enter key (=) computes the result. Backspace key (⌫) deletes the last digit.

Running the Calculator

Prerequisites Java Development Kit (JDK) installed on your system.

Compilation

  1. Save the Calculator.java file.
  2. Open a terminal or command prompt.
  3. Compile the code using the command: javac Calculator.java

Execution

  1. Run the compiled Java application using: java Calculator

Special Instructions Keyboard Input: Use the keyboard for quicker input and operations.

Error Handling: Division by zero or invalid inputs are handled with appropriate error messages.

Layout Considerations: The UI uses absolute positioning (null layout), which may need adjustments based on screen resolution.

Example Usage

  1. Click or type numbers and operations.
  2. Utilize both mouse and keyboard inputs for efficiency.
  3. Watch the operation label update dynamically with each action.
  4. Error messages, such as division by zero, are displayed in the text field."# Calculator"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages