Skip to content

This project is an actuarial calculator. Developed in the language of C#, FISCAL 2.0 performs financial calculations on a razor's edge, implementing a user-friendly system with smooth error handling. Its design is a fusion of 1980’s aesthetic with modern technology.

License

Notifications You must be signed in to change notification settings

nuclearcheesecake/fiscal2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

FISCAL 2.0 - UX-driven actuarial calculator built using C#

Table of Contents

Background

I think that most programmers look back at their first large project with a mix of nostalgia for a simpler time and a healthy amount of gratitude that we have grown past the use of spaghetti code.

I am no exception to this thought.

FISCAL was my first real project. At the time, I was just starting my journey down the path made of codeblocks. I had serious doubts as a programmer, since prior to my degree, the world of programming was foreign to me, and suddenly, I had this daunting task of creating a functional application - that can leverage financial mathematics!

I remember the endless nights in my dorm room, stretched over two months, pouring over documentation. And then a quick walk to my friend's room to vent my frustration, and then back at the computer, reading and coding. And then...suddenly, success.

This application formed a part of my financial mathematics modules, and we were required to build a system that can perform actuarial calculations. Most people completed this task in Excel, but at the same time, I was busy with another module in Graphical User Interfaces, where we created small apps in Visual Studio 2017 using C#. Quickly the idea formed to streamline the user experience using this technology, instead of Excel which, albeit powerful, did not have the interface functionality I desired.

Thus the Financial Solidarity Calculator, or FISCAL, was born.

User Experience (UX) was a big focus for me, and the design was always kept in mind when coding. The decision to move to C# is justified then, looking at the...interesting design capabilities I had in Excel at the time. My design in C# is also not very sleek or modern, but I still get the warm fuzzies, knowing a lot of thought went into every button on every page.

This project was a milestone in my early development, and I'm happy to share it with you today.

FISCAL 1.0 in Excel

I, like my peers, started this project in Excel. Albeit horrendously ugly, as seen below, this simple layout inspired my further designs for FISCAL's homepage. Each button takes you to the specific actuarial function that needed to be performed:

Here, for example, is a simple flow, where the user would decide the specific parameters, which eventually redirected them to a screen where they could input data:

Presenting FISCAL 2.0

Improving, in my sensibilities at least, on 1.0, FISCAL 2.0 created a more streamlined UX with stronger programming power. Below are the pitches for the product, which I had to give in two different contexts. Let's look at that before we explore FISCAL 2.0, just to see if my presentations would have sold the idea to you at the time.

Project PowerPoint

Firstly, I had to present the project to my lecturers. Here are the most important slides in this presentation;

GeeXpo presentation

Each year, our campus held GeeXpo, an exhibition of IT talent and possibilities. Students from various surrounding high schools are invited to come take part in competitions, attend seminars and see what the world of studying tech holds for them. I was asked to present FISCAL 2.0 to a group of students. Little did I know I'd be the last to make such a presentation, due to the pandemic hitting the next year, but that is unimportant for this story.

Here is a poster for the 2019 event:

And here are my most important slides. I ended up pitching the importance of data science in our society way more than showcasing my project, but hey, trying to stop a data science student when he is passionate about his work is a cardinal sin.

Explanation of functionality

Now, at last, let's have a look at what this application is capable of. I won't really be explaining or sharing code here, since most of it is like this...

else
{
  if (Global.LANG_GERMAN == false && Global.LANG_AFR == false)
  {
    if (MessageBox.Show("Continue without entering your username?", "Continue?", MessageBoxButtons.YesNo) == DialogResult.Yes)
    {
      if (tutorial == false)
      {
        this.Hide();
        Form1 f1 = new Form1();
        f1.Show();
      }
      else if (tutorial == true)
      {
        Form15 f15 = new Form15();
        f15.Show();
        this.Hide();
       }
     }
  }
    else if (Global.LANG_AFR)
    {
       if (MessageBox.Show("Gaan voort sonder om gebruikersnaam in te sleutel?", "Gaan voort?", MessageBoxButtons.YesNo) == DialogResult.Yes)
       {
          if (tutorial == false)
           {

              this.Hide();
              Form1 f1 = new Form1();
              f1.Show();
           }
           else
           {
              Form15 f15 = new Form15();
              f15.Show();
              this.Hide();
           }
         }
       }
       else
       {
           if (MessageBox.Show("Fahren Sie fort, ohne einen Benutzernamen einzugeben?", "Fortsetzen?", MessageBoxButtons.YesNo) == DialogResult.Yes)
           {
              if (tutorial == false)
              {
                   this.Hide();
                   Form1 f1 = new Form1();
                   f1.Show();
               }
               else
               {
                   Form15 f15 = new Form15();
                   f15.Show();
                   this.Hide();
                }
          }
    }
                    
  }
}

... which is just a simple login request when no password was entered. The experience I obtained in programming, project work and application control still means a lot to me, but the literal value of my code is nothing to write home about.

There is however one function that I am exceptionally proud of. To find the interest rate of an annuity, neither of my friends nor I could isolate the interest rate variable from the annuity formula. Thus my first dabble into numerical analysis began, where I created two bounds to search between, and numerically evaluate the present value formula for different interest rate values:

else if (checkInterestY.Checked && checkInterestP.Checked && checkInterestZ.Checked)
{
    presentVal = double.Parse(txtEnterY.Text);
    payAmount = double.Parse(txtEnterP.Text);
    term *= period;

    double lowerBound, upperBound, testPV, testInterest = 0;
    bool found = false;

    lowerBound = presentVal - (presentVal * 0.000001);
    upperBound = presentVal + (presentVal * 0.000001);

    while (found != true)
    {
         testInterest += 0.000001;
         testPV = (payAmount * (1 + testInterest) * (1 - (Math.Pow((1 + testInterest), -term)))) / testInterest;

         if ((testPV >= lowerBound && testPV <= upperBound) || testInterest > 1)
         {
              found = true;
              interest = testInterest;
              MessageBox.Show(interest.ToString("p"));
              break;
         }
         if (testInterest >= 1)
         {
              MessageBox.Show("No interest could be found for this amount.");
              break;
         }
    }
}

This was a great stride in my mathematical career, when I realised the potential of mathematical functions. But enough dilly-dallying - let's get to the application!

Home page

When the application is booted, the user is greeted with the following:

Which loads into:

And then:

Now we can discuss some key features of this home page:

  • FISCAL 2.0 was availabe in 3 different languages
  • It accepted returning users with their passwords, allowing them to store calculations from previous use
  • However, one could use the app without even entering a username
  • There is an option to see a quick tutorial before starting
  • The session could be printed, which saves all calculations and variables to a .txt file

Automatically, the language of the application is English:

But it is also available in German and Afrikaans:

When logging on, the main menu appears:

If we have selected to print the session, the following button is available to print our work:

If 'Developer Notes' is accessed, one could find a reference to FISCAL 1.0, in the form of the old mascot:

If 'Integrate Answers' is accessed, three different pages can be accessed that adds extra functionality to the calculator. These are not the main functions of the app, but just an aside:

If the first page is chosen, one has the option to combine different functions of the app as each other's input:

On the second page, one can calculate the amount needed to invest to be able to retire:

And on the third page, one could calculate whether or not an applicant should be accepted for a loan based on credit score and salary:

Converting interest rates

In the main menu, the first option leads to this page. This is the first main function of the app - to convert interest rates between different types and compounding periods.

If you want to use this newfound rate on a different page, it can be saved:

Each page in this app also has a helpful 'Help' button that gives further instructions to new users:

Single Investments

Another function of this app is to be able to compound single investments for a certain period, and all the calculations an actuarial student would usually receive around this subject.

Annuities

We can also work with different annuities, and all the different aspects of them, such as whether or not they are increasing:

Loans

Calculating various values around loans are also made easy:

Amortization Tables

And finally, the amortization table, which can be neatly displayed given all the input values:

Here are the outputs:

Conclusion

In the end, I scored 95% for this assignment, and was pleased that my first rabbit hole into application programming was recognised.

Two of my fellow students and I were also entered into an inter-campus competition, where several students' actuarial calculators compete. FISCAL 2.0 obtained a second place. I am very proud of my silver medal - it proved to me that coding only needs guts and an internet connection to master.

Thank you for reading, and sharing in this first project of mine, accompanying me as I stroll down memory lane.

About

This project is an actuarial calculator. Developed in the language of C#, FISCAL 2.0 performs financial calculations on a razor's edge, implementing a user-friendly system with smooth error handling. Its design is a fusion of 1980’s aesthetic with modern technology.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published