Python Console Application | Mathematical Calculations

Source code Screenshots

Project Background

This project involved converting a Java console application that handles mathematical calculations to a Python program.

Discovery

A Java file containing Java code was supplied which needed to be converted into Python.

The program also needed to be updated to include a fourth menu option that would allow the user to exit the program.

Development

The application was written in Python and developed within the PyCharm IDE.

The application contains a main menu that gives users access to program functionality to calculate the area of a square or circle, display palindromes up to 1,000 or exit the program. The main menu displays after every task completed by the user until the user selects to exit the program.

Written code is well organised and readable with comments.

Testing

A black box test was conducted after developing the Python program to test whether the functionality was the same as the Java program. An issue found during testing of palindrome numbers not displaying when the user enters menu option 3 was resolved after white box testing revealed the error within the code.

Testing also revealed errors within the inital Java code provided for the project which was corrected and updated for the Python developed program.

Deployment

The source code was uploaded to a GitHub repository after completing this project.

Evaluation

Enhancements included error handling for when a user enters a character instead of a number and updating the message displayed to the user.

Take a Closer Look

The screenshots below show what the application looks like in action.

Screens for User Interaction

The Main Menu

A screenshot of the main menu

Area of a Square Calculations

A screenshot of calculating the area of a square

Area of a Circle Calculations

A screenshot of calculating the area of a circle

Palindromes up to 1,000

A screenshot of displaying palindromes up to 202 A screenshot of displaying palindromes from 212 to 606 A screenshot of displaying palindromes from 616 to 797 A screenshot of displaying palindromes from 808 to 1,000

Error Handling

A screenshot of the user entering an invalid number or character

Exiting the Program

A screenshot of exiting the program

Top of page