Skip to main content

All Questions

Tagged with
0 votes
1 answer
50 views

Aggregate transactions in slips

I wrote code to aggregate transactions in slips. I'm concerned with the performance of my code because it uses 3 loops that are nested so the time complexity will be cubic. This code won't scale well ...
bit's user avatar
  • 143
3 votes
3 answers
2k views

Simple credit card validation with Luhn's Algorithm

Originally written in C (which was abysmal, you may check here if you want), I rewrote my simple credit card validation program using Python ...
flamethrower10's user avatar
5 votes
1 answer
54 views

Calculate quote volumes (for a financial instrument) within numeric constraints

The function below is part of a trading system. Its purpose is to assign a volume (order size) to a bid (buy) quote and and ask (sell) quote, depending on the value of the ...
s_dbq's user avatar
  • 83
2 votes
0 answers
99 views

Computing most-cost effective loans in financial graphs using Java

Problem statement We are given a directed graph \$G = (V, A)\$, where \$V\$ is the set of actors and \$A \subseteq V^2\$ is the set of directed arcs. Existence of an arc \$(u, v) \in A\$ is ...
coderodde's user avatar
  • 28.9k
5 votes
1 answer
1k views

Banking: Calculate the Capital Requirement to calculate Risk-Weighted Assets

I know it's not the perfect code, but it outputs the correct values. Could anyone give me some pointers on how to make the operation more Pythonic? ...
Tom Cusack-Huang's user avatar
4 votes
1 answer
6k views

Basic Internet banking application

I programmed in Java before, but I feel that I lack the "true way" of programming (OOP concepts, design, algorithm), so I started to learn all of these but I need your opinions and suggestions so I ...
Alexandru Cosmin's user avatar
12 votes
5 answers
6k views

Credit card validation

I started following Harvard's CS50 (Introduction to Computer Science) on edX, and as part of their Hacker edition set 1 was the following assignment: I am supposed to write a program (in C), that ...
Stefan Rendevski's user avatar
3 votes
2 answers
2k views

Artificial Stock Market Algorithm

I'm attempting to make a stock trading game in Javascript and I've been trying to find an algorithm to generate fake stock prices. Currently, each Stock object has ...
mdc32's user avatar
  • 139
18 votes
3 answers
12k views

Credit card validator using Luhn's algorithm

I'm writing an algorithm to read from a file a list of numbers, and for each, determine if it is valid. If it is, then display which card type it is. ...
Ryan Dougherty's user avatar
12 votes
2 answers
375 views

Calculation of an inflation on volume/year

I would like to find out if my current solution to the problem described below is "good enough" or if there is an alternative way of achieving it. All I care about is the length (no. of ...
user avatar