Skip to content

sarawalid99/Rational_Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rational_Calculator

Made by : Sara Walid - Khadija Eshra - Shawky Ebrahim

Requested by: Dr. Mohammed El-Ramly in Structured Programming course.

Purpose:

This program is a simple rational number calculator that performs basic arithmetic operations on rational numbers. It allows you to input a rational number expression and calculates the result. The rational numbers are represented as pairs of integers, where the first integer represents the numerator and the second integer represents the denominator.

Functionality:

  • make_variables(): Clears all variables and prepares for a new input.
  • take_input(): Takes user input for the rational number expression.
  • is_valid(): Validates the input expression for any invalid characters or syntax errors.
  • solve(): Breaks down the expression into individual blocks and performs the arithmetic operations.
  • print_solution(): Prints the final simplified result of the expression.
  • start(): Starts the calculation process by calling the necessary functions based on user input.

Note:

The code uses the C++ Standard Template Library (STL) and requires the <bits/stdc++.h> header, which may not be available in all C++ compilers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages