//1.Let's try to develop a program which calculate measure of central tendency of a sample(mean, median, mode) and measure of variability(range, variance, standard deviation). In addition to those measures find the min, max, count, percentile, and frequency distribution of the sample. You can create a class called Statistics and create all the functions which do statistical calculations as method for the Statistics class. Check the output below.
//2.Create a class called PersonAccount. It has firstname, lastname, incomes, expenses properties and it has totalIncome, totalExpense, accountInfo,addIncome, addExpense and accountBalance methods. Incomes is a set of incomes and its description and expenses is also a set of expenses and its description.
letformattedIncomes=`${incomeKeys.slice(0,-1).join(', ')} and ${incomeKeys.slice(-1)}`;
letexpenseKeys=Object.keys(this.expenses);
letformattedExpenses=`${expenseKeys.slice(0,-1).join(', ')} and ${expenseKeys.slice(-1)}`
letinfo=`This is ${this.firstName}${this.lastName}'s account.\nThe user has incomes from ${formattedIncomes}.\nThe total income is ${this.totalIncome()}.\nThe user has expenses from ${formattedExpenses}.\nThe total expense is ${this.totalExpense()}.`