3732 Shares

# How long does it take to write a program?

Topic: How to write a calculator program
July 19, 2019 / By Carly
Question: For example, if you learnt programming from a book / the Internet, then set about writing programs. How long would it take you to write programs? I would imagine the more graphics intensive, the longer it would take? eg - How long to write pacman, a word processor, a caluclator, a program that uses a database?

## Best Answers: How long does it take to write a program?

Anette | 5 days ago
believe it or not programs can be written within seconds. sure, they do remedial tasks like scan documents or basic calculations, but, depending on your goal for the program, you can literally write one within seconds. perl, python, php, are just a couple of programming languages that make this possible due to their high level of programmer friendliness (called high level languages). :p it's going to take time for you to write anything that you would consider substantial, believe me. (except maybe a calculator. they are VERY easy because of high level languages and their ability to do math internally) but the fun in programming is learning. be patient. learn and have fun. that's what it's all about. :)
👍 158 | 👎 5
Did you like the answer? How long does it take to write a program? Share with your friends

We found more questions related to the topic: How to write a calculator program

Originally Answered: Write a program with an array? (long?)?
Your idea of how to store the values is not at all correct. You might consider using an array to count how many times a number occurs, but you cannot use one efficiently to store the values as they come in. This is because you cannot know how many numbers the user will input. Thus, you must store the input in a structure that can handle an arbitrary number of elements. Try this instead: http://download.oracle.com/javase/1.5.0/docs/api/java/util/List.html Your loops are poorly conceived. First, you need to loop an indefinite number of times to get the input from the user, checking each time to see if it is zero and the loop needs to end. That is all the first loop should do. You cannot create the container in such a loop, otherwise it will be destroyed and reformed again each time the loop runs. Then, in completely separate loop, you need to iterate through the container, grabbing the values and counting them. Then, go through and display the appropriate output. This loop should not be in the first loop, because that does not make any sense. I would also recommend that you not leave off the braces for single line else and if statements, as it confuses many beginners. Good luck!

Wiley
Time taken to write program depends on following factors: 1. Programming language used. 2. Tools used for the writing program. 3. Program definition and its scope. 4. GUI - front end design technologies. 5. Backend operations techniques i.e. data base, flat files etc. 6. No of people used for developing application. Various factors can be used to predict no of days to write program. There is no theory or formula that wil return you exact no of days to write progrm and you must know that this is clearly human dependent.
👍 60 | 👎 -1

Saxon
I as soon as wrote a software with over 9000 traces of C++ code (no, that is now not a connection with the 'over 9000' meme). However I did not appropriately fully grasp C++ on the time and so the code was once beautiful inefficient. I could have written a Java software longer than this, however I do not consider so.
👍 56 | 👎 -7

Nathaniel
Each person is going to take a different amount of time. After enough practice and knowing what your doing you can do it very quickly.
👍 52 | 👎 -13

Originally Answered: How will i start my program if i have to write a program that find the chain associated with any given number?
I'm assuming that you wish to collect your answers and submit them all at once. For this, use a linked list (or a dequeue or a dynamic array, depending on which programming language your'e using). As you calculate the next element of the chain, add it onto the end of your linked list. After each item, see if you have created a cycle. The pseudocode may look like this: Chain(int n) define a linked list L add n to L return RecursiveChain(L) RecursiveChain(linked list L) define integer n = end of L define array A = GetDigits(n) define array Arev = reverse(A) (this may require a loop through A) define array Diff define integer m = 0 for(i = 0 to length(A) - 1) Diff[i] = Arev[i] - A[i] m = m * 10 m = m + Diff[i] (these two lines rebuilds the difference as a number end for add m to the end of L define integer lencycle = FindCycle(L) if(lencycle > 0) then return (lencycle, L) else return (RecursiveChain(L)) end if GetDigits(n) define array A for(i = 0 to log(n)) <-- this is log base 10 A[i] = (floor(n / 10^i)) mod 10 (this will get base 10 digit for the ith position) end for sort A in ascending order (this can be done easily in *most* languages) return A FindCycle(L) define integer end = the last element of L define integer lencycle = 0 for(i = 0 to length(L) - 1) (note, we can loop forward through the loop because we are guaranteed to find at most one cycle, else the program would have finished already) if(L[i] == end) then lencycle = length(L) - 1 - i end if end for return (lencycle) hope this helps, and remember to put this into your own words if this is homework. -HMF

If you have your own answer to the question how to write a calculator program, then you can write your own version, using the form below for an extended answer.