Skip to content

mohitahlawat2001/MathematicsSwitchApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathematicsSwitchApp

The user can input a list of numbers in any order, separated by a comma, into the web application. After inputting their numbers, the user can select which type of statistics they would like to calculate from their list. To calculate the desired statistics, the application utilizes a Switch Statement to determine which formula to apply to the list of numbers.

For this project, we have decided not to use any framework. Instead, we will be using VanillaJS to interact with the Document Object Model by utilizing the document keyword. Let's begin!

For this project, we'll use an input and a button element. The external CSS and JavaScript will be written to support the application.

  • Use Switch Statements to apply the appropriate formula

  • Obtain values from the HTML DOM

  • Apply the “default” use case on the Switch Statements

This quest involves creating mathematical functions such as sum, average, min, max, median, mode, and range. As part of the deliverable requirement, you are expected to code the "mode" function yourself.

Demo App

Screenshot (209)

Here are the definitions of the mathematical functions:

  • Sum: the total addition of all values in a list
  • Average: the sum of values in a list divided by the total number of items in the list
  • Min: the smallest value in a list of numbers
  • Max: the largest value in a list of numbers
  • Median: the middle value of a data set when arranged in order from least to greatest
  • Mode: the value or values that appear most frequently in a data set
  • Range: a measure of the spread or dispersion of a data set, calculated as the difference between the maximum and minimum values in the data set.