use JavaScript in Atom
Q1: create functions.js. You do not need to create a web page (.html) for this requirement. As you write each function, test it using the DevTools console. When it is correct, move on to the next function.
A) Write a function named isVowel that accepts a character and returns true if the character a vowel, false otherwise. Use a RegExp to solve this problem, and arrow function syntax.
Examples: > isVowel('Y')
> true
> isVowel('@')
> false
> isVowel('7')
> false
> isVowel('n')
> false
b) Write a function named daysInMonth that accepts a month number (1 .. 12) and returns the number of days in the month, leap years excluded. Use an array of length 12 to store the number of days in each month. Use arrow function syntax. Examples:
> daysInMonth(1)
> 31
> daysInMonth(2)
> 28
c) Write a function named daysInMonth_v2 that accepts a month number (1 .. 12) and a 4-digit year, and returns the number of days in the month, leap years included. Use an array of length 12 to store the number of days in each month. Use your isLeaper function from P3 to recognize leap years. Use arrow function syntax. Examples: > daysInMonth_v2(12, 2019)
> 30
> daysInMonth_v2(2, 2020)
> 29
d) Write a function named reverseWords that accepts a sentence of words separated by one space, and returns a sentence with each word reversed. reverseWords must call getWords and reverseString as part of the solution. See our class notes for how to reverse a string. Use arrow function syntax. Examples:
> reverseWords ('The quick brown fox')
> "ehT kciuq nworb xof"
> reverseWords ('abc defg')
> "cba gfed"
CODE
============
var isVowel = (char) => {
if (char.length == 1)
{
return /[aeiou]/.test(char);
}
}
var daysInMonth = (month) => {
let months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
return months[month-1];
}

NOTE: As per Chegg policy, I am allowed to answer only 2 coding questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
use JavaScript in Atom Q1: create functions.js. You do not need to create a web page...
Write a C++ program that will count the number of words and vowels in a sentence. Create a bool function called isVowel that accepts a character as a parameter and returns a true if it’s a vowel (aeiou) and false otherwise. Create an int function named countVowels that will accept a string variable as a parameter and will return the number of vowels in it. Call the isVowel function as part of this process. Write an int function named countWords...
CODE THE FOLLOWING FUNCTIONS IN JAVASCRIPT (USE OF THE
ABOVE MENTIONED IN BUILT FUNCTIONS IS NOT ALLOWED)
Write a function that accepts an array as argument. The function
should loop through the array elements and accumulate the sum of
ASCII value of each character in element and return the total. For
example: function([‘A’, ‘bc’, 12]); // returns 361 which is the sum
of 65 + 98 + 99 + 49 + 50
Write a function that accepts two arguments (a...
In C++ Do not use a compiler like CodeBlocks or online. Trace the code by hand. Do not write "#include" and do not write whole "main()" function. Write only the minimal necessary code to accomplish the required task. Save your answer file with the name: "FinalA.txt" 1) (2 pts) Given this loop int cnt = 1; do { cnt += 3; } while (cnt < 25); cout << cnt; It runs ________ times ...
Need help with these, especially number 4. C++ program
L. WIite the function Write a function mpgcalculator that accepts pointers to three arrays. The firstis an array of miles, the second is an array of gallons, the third will hold mile-per-gallon. It has no return value. 4. a. b. c. d. write the prototype call this function with these three arrays: miles, gallons, mpg. write the function use only array notation 5. Do #4, using only array with offset notation....
IN C++ In a previous assignment you wrote pseudo code for the calculation of the days into a year given the date. Write a function that returns an int. It takes three parameters , all int(s), int DaysIntoYear ( int Year, int Month, int day); The return value is the number of days in the year from January 1 to the specified date. Year is included so you can determine if this is a leap year ( see below). If...
1.1. Write a function named "areFirstTwoTheSame AsLast TwoChars" that accepts a string. It returns true if the first two characters and the last two characters of the string are the same. It returns false otherwise. In addition, if the string is empty or has only one character, it also returns false. For example, these are the strings with their expected return values false falsc "AB" true "ABA" false "ABAB" trus "ABBA" false "ABCABC false "ABCCAB" true 1.2 Write a function...
FINDING THE LEAP YEARS (14 points) From Wikipedia, "A leap year (also known as an intercalary year or bissextile year) is a calendar year containing one additional day (or, in the case of lunisolar calendars, a month) added to keep the calendar year synchronized with the astronomical or seasonal year." In the Gregorian calendar, which is in use today, to determine leap year: A year is a leap year if it is divisible by 400 Or it is divisible by...
C++ I do not understand this problem.
14THE GREATEST COMMON DENOMINATOR PROBLEM Write a function named god() that accepts two integers as input parameters and returns the greatest common divisor of the two numbers. The greatest common divisor (GCD) of two integers, a and b, is the largest integer that is a factor of both a and b. The GCD of any number and 1 is 1, and the GCD of any number and o is that number. One efficient...
Must be done in PHP. Details below:
NOTE: in #4 part B, the split function that my teacher wants me
to use in this program is: str_split()
1. Create a new document in your text editor (notepad++) 2. Type the <html element, header information, and <body element. Use String Manipulation functions as the content of the <title element 3. Add the following standard PHP script delimiters to the document body: ?php 4. In the php script section write the appropriate...
write a Matlab program ( solve the three questions). please use array and create your own function to check primality Question 1 : [10 points) Write a MATLAB program that will store all the first 1000 prime numbers in an array variable named arr_of_primes. Please note that a prime number is a positive integer that is bigger than or equal to 2 which is divisible only by 1 and itself. Examples of the first 8 primes are: 2, 3, 5,...