Skip to content

W1llyS/Calculator_basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Calculator_basic

Basic calculator is a mobile-first ASP.NET WebForms application with a clean, intuitive UI for basic arithmetic (+, -, *, /), optional whole-number rounding, and a scrollable history of your last 10 calculations. The application is also unit tested to ensure reliability and correctness.

🚀 Available at: https://afsddafs.bsite.net/


Features

  • Mobile-First Design: Fully responsive layout, usable on phones and desktops.
  • Basic Operations: +, -, *, / with divide-by-zero handling.
  • Rounding: Optionally round results to the nearest whole number.
  • Calculation History: Stores last 20 calculations in a SQL Server database and displays the 10 most recent.
  • Layered Architecture: Clear separation of concerns:
    • Presentation: ASPX + code-behind
    • Services: ComputeService & CalculationService
    • Data Access: IDataAccess with Dapper implementation

Interface Preview

Desktop View

Desktop Calculator

Mobile View

Mobile Calculator


Technologies Used

  • Framework: .NET Framework 4.7.2 (ASP.NET WebForms)
  • Language: C#
  • Data Access: Dapper
  • Logging: Serilog
  • Unit Testing: MSTest, Moq
  • Database: SQL Server
  • IDE: Visual Studio 2022

Usage

  1. Enter two numbers in the input fields.
  2. Check Use whole numbers to round the result to whole numbers.
  3. Click one of the operation buttons (+, -, *, /).
  4. View the result in Results and the recent history in History.
  5. Logs are written daily under App_Data/Logs.

Basic Error Handling

The application handles common errors gracefully and informs the user without crashing.

  • Divide by zero triggers a clear user-facing message.
  • Invalid input (e.g., text instead of number) results in a friendly error display.

Divide by Zero Invalid Input


Future Improvements

  • Migrate UI to ASP.NET MVC or Blazor
  • Refactor logging (Serilog)
  • Dark mode
  • Mobile app

About

Mobile-first ASP.NET WebForms calculator with scrollable history and optional rounding

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published