How to write numbers in Japanese over 20?

How would you write a program to create a frequency table from entering 20 numbers in pascal for numbers 1-5?

  • Basically, how would one write a program in pascal language, using arrays to create a frequency table from the numbers entered?   So the user would input 20 numbers, (from 1-5) and then the output would be something like 1     5 2     7 3     8 4     0 5     0

  • Answer:

    You can do this: procedure FreqTable; var i,j : integer; ftable : array [0..4] of integer; begin // reset the array values to 0 for i := 0 to 4 do ftable[i] := 0; for i := 0 to 19 do begin readln(j); if (ftable > 5) then continue; ftable[j - 1] := ftable[j - 1] + 1; end; // display the contents of the frequency table array for i := 1 to 5 do writeln(i, ftable[i - 1]); end; This procedure is basic at best. It always assumes that there are 20 numbers being entered.

Phillip Flores at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.