Magical Indices
Given an array of integers and a number
Write a JS program to determine the number of valid indices.
For example, an array A = [10, 20, 30] and a value x = 25.
We have values 10, 20, 30 at indices 0,1,2 respectively.
So there are 2 valid indices.
Sample Input 1
[1, 2, 3, 5, 7]
13
Sample Output 1
3
Sample Input 2
[34, 32, 37, 38, 40]
10
Sample Output 2
Product of Array Items
Given an array
Sample Input 1
[1, 2, 3]
Sample Output 1
1 * 2 * 3 = 6
Sample Input 2
[-1, -2, -3]
Sample Output 2
-1 * -2 * -3 = -6
Replacing Array Item
Given an array
Sample Input 1
[1, 2, 3, "four", 5, 6]
"four"
4
Sample Output 1
[ 1, 2, 3, 4, 5, 6 ]
Sample Input 2
[22, 44, 88, 352, 352]
352
176
Sample Output 2
[ 22, 44, 88, 176, 352 ]
Squares of Array Items
Given an array
Sample Input 1
[[1, 2], [3, 4], [5, 6]]
Sample Output 1
[ [ 1, 4 ], [ 9, 16 ], [ 25, 36 ] ]
Sample Input 2
[12, [24], 36, [48, 60]]
Sample Output 2
[ 144, [ 576 ], 1296, [ 2304, 3600 ] ]
how to write the program for polynomials
how to write the matrix rotation program
how to find out the antidiagonal matrix
given string in camel case and convert the camel case to snake case
How to convert the string fro camel case to snake case
The Bone Jour Dog Day Care Centre charges clients a daily rate that is based on both the size of the dog and number of days per month in a client’s contract. The following tableshows the daily rates.Prompt the user to enter a dog’s weight and number of days per month needing care, then calculate and display the daily rate and the total for the month (days times the daily rate). Save the file as DogDayCare.java