-
Notifications
You must be signed in to change notification settings - Fork 1
Aryan Create Task final NumberHub
FINAL PROGRAM-
Program purpose and Function
The program has a simple purpose. To inform the user of the number they want to be informed about. The user can input any random integer they desire into the UI textbox. It will return on the UI where the number is prime, even, or odd, and will also give a mathematical fact
Data Abstraction
I will use rapid API to get an API that gives random math facts on numbers. This is a form of data abstraction because API's hold JASON data and it helps to eliminate hard coding any lists which would only allow usage of minimal values.
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 loops as mentioned previously to create more efficiency and allow me to manage any complexity in the code. The usage of an API also eliminates the necessity to hard code any form of long arrays or lists, and instead allows me to pull data from a large JSON collection.
**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 action listener function in javascript and connect to the text field where the user puts the input and then will be captured into a variable. Then I can call my function and pass the users' input in the parameters in order to check if they are even or odd, prime, and to give a fact.
Algorithm Implementation
the developed algorithm that includes:
- sequencing The data values will be sequenced into an array. This will allow strategic values to be accessed when running the program. They will be placed in a specific order to allow the efficiency selection and the overall function to work.
- selection The if statements will select the correct indexed value within each respective Array. This will be allowed by effective sequencing and iteration that allows the if statement to check multiple times whether the value is met with that of the 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. It will allow the elimination of numerous amount of if statements.