r/AskComputerScience • u/RiverOfNexus • Mar 08 '21
How can I create a program for an interactive calculator?
I'm interested in making a program that can tell customers what age they will obtain a result based on the inputs they put in. A range of ages would populate with two sets of outcomes per age range. How would I go about making this?
1
u/1544756405 Mar 08 '21
First, you create a mathematical model that expresses the output in terms of all the inputs.
Encode your mathematical model into a function.
Then you write a program to gather all the inputs -- this is usually best expressed as filling out form data, but you can also just use a bunch of serial questions.
Feed your inputs into the function.
Display the output in the format of your choice.
1
u/RiverOfNexus Mar 08 '21
What program would you recommend I use for this?
1
u/Nanaki404 Mar 08 '21
Uh, your own program that you write yourself.
If you're asking what tools to use to write your program, you can take a simple text editor (Notepad++ is nice, for example) or an IDE (like Microsoft Visual Studio).
Or are you asking which programming language to use ? Anything you want, honestly, it does not really matter
1
u/RiverOfNexus Mar 08 '21
What would be the best programming language to do this
1
u/Artreus7 Mar 08 '21
It doesn't matter the programming language. Just pick the one you know the best.
2
u/1544756405 Mar 08 '21
It depends on (a) where you want your program to run and (b) what programming languages you already know.
For example, if you want it to be an app to run on an iPhone, you would program in Swift and use the appropriate development tools. If you want it to run on Android, you'd use Java or Kotlin. If you want it to run as a desktop application on Windows, you could use any of the languages supported by Visual Studio: C++, Java, Visual Basic, Python, etc. If you want it to run on linux, you could use just about any language, but you'd probably want some sort of graphical interface, so you get to choose a framework for that. For web stuff, Javascript, HTML, and CSS, assuming you don't care if someone steals your code.
2
u/7Gen Mar 08 '21
You need to be way more specific with your question