Skip to content

Create Task Aryan plan Number Language Converter

Aryanboxout edited this page Feb 11, 2022 · 1 revision

Program purpose and Function I often need help sometimes to convert a number to the language and people of all languages sometimes need this assistance too. Numbers today are universally known in terms of the script but not language. So my program will be designed to convert numbers to their word counterparts in English, Spanish, and Hindi.

Data Abstraction I am going to create an array which will hold values for example: {uno, dos, tres} i will be indexing these Arrays. JavaScript arrays are zero-indexed so this means the first element of an array is at index 0 , and the last element is at the index value equal to the value of the array's length property minus 1 . This is how my data will be stored as it will use indexes for each of the values. To implement this data usage in my code every time the user enters a value it will use use that value and run a for loop over and if statement to check every index value in the array that is entered. Managing Complexity I will organize and break my code up systematically into efficient tasks to designate each desired goal for the total outcome. I will use factors like for loops as mentioned previously to create more efficiency and allow me to manage any complexity in tho code.

Procedural Abstraction THis is the program's overall procedure and how it takes an input and gives out an output. In this case I am going to use the get element function in javascript and connect to the text field where the user puts the input. This then goes through a for loop of if statements which check for the index and then match it. It will then print the correct index from the array.

Algorithm Implementation

developed algorithm that includes:

  • sequencing The data values will be sequenced into an array
  • selection The if statements will select the correct indexed value within each respective Array
  • iteration For loop will simplify the code and decrease the number of for loops as iteration repeats the process is a short amount of written code.

Clone this wiki locally