Skip to content

Jpx-lang/Calculator-jpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

JPX Simple Calculator Example

This example demonstrates how a simple calculator program can be built using the JPX programming language.

The project shows how to combine multiple JPX features such as:

  • User input with the Scanner module
  • Arithmetic operations
  • Conditional logic
  • Functions
  • Output using Print

Features

The calculator program supports basic arithmetic operations:

  • Addition
  • Subtraction
  • Multiplication
  • Division

Users can input numbers and select an operation, and the program will display the result.


Modules Used

This example uses several built-in JPX modules.

Scanner Module

Used to receive input from the user.

Example usage:

[Scanner];

The module allows programs to read text input from the terminal.


Concepts Demonstrated

The calculator example demonstrates the following JPX syntax concepts:

Variables

Storing numbers entered by the user.

Arithmetic Operations

Performing mathematical calculations.

Functions

Organizing calculation logic into reusable blocks.

Conditional Statements

Handling operation selection such as addition or subtraction.


Running the Example

  1. Install JPX from the official repository.
  2. Download the example project.
  3. Run the calculator script using the JPX runtime.

Example command:

jpx run calculator.jpx

Learning Purpose

This example is designed for beginners who want to understand:

  • Basic JPX syntax
  • Working with input
  • Performing calculations
  • Structuring simple programs

Repository

JPX official repository:

https://github.com/jpx-lang


License

This example project follows the same license as the JPX language project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors