Square at Alternate Indices
Sample Input 1
[ 1, 2, 3, 4, 5 ]
Sample Output 1
[ 1, 2, 9, 4, 25 ]
Sample Input 2
[ 2, 4 ]
Sample Output 2
[ 4, 4 ]
String Slicing: Given two strings inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString. Slice the inputString starting from the subString to the end of the inputString.
Input
The first line of input contains a string inputString
The second line of input contains a string subString
Output
The output should be a sliced string or inputString (if the inputString does not include the subString)
function main() {
let inputString = readLine();
const subString = readLine();
/* Write your code here */
}
i want code in between write code here
Write a JavaScript Program (Using a single HTML and JavaScript file)
to input 2 numbers and determine (using a <p> tag whether:
a. The 2 numbers are equal
b. The first is greater then the second.
c. The second is greater than the first.
Display the message on change of any of the 2 inputs.
Input the Taxable Income and Compute the income tax using the following table:
*Note: Do not use prompts for user inputs. Use the HTML input tag.
over -----------------------------but not over --------------------------------Rate
--- -----------------------------------250,000 ------------------------------------0%
250,000 ---------------------------400,000 ---------------------20% of the excess over 250,000
400,000----------------------------800,000------------- 30,000+25% of the excess over 400,000
800,000------------------------ 2,000,000 ------------130,000+30% of the excess over 800,000
2,000,000 ----------------------8,000,000 -----------490,000+32% of the excess over 2,000,000
8,000,000 ------------------------------------------2,410,000+35% of the excess over 8,000,000
Ex)
Taxable Income Income Tax
180,000 0
320,000 14,000
520,000 60,000
930,000 169,000
2,400,000 618,000
10,000,000 3,110,000
6. Write a program that asks the user for two numbers, then lets the user choose the using 4
buttons, one for each operation. (+, -, *, / )The program should do the requested operation and
display the answer on the screen.
7. Modify program 6 to do the same thing using a dropdown menu and an = button to execute.
Use <select> <option></option></select> for your dropdown. Only java plz
Write a program that asks the user for two numbers, then lets the user choose the using 4
buttons, one for each operation. (+, -, *, / )The program should do the requested operation and
display the answer on the screen. Only Java plz
Write a Javascript Program to Add,Delete employees in a payroll list.
1. The payroll program should input the following:
Employee Name Days Worked Daily Rate Deduction Amount
2. During Addition, the program should display the following in a table:
No. Employee Name Days Worked Daily Rate Gross Pay Deduction Amount Net Pay
where:
No. = is the Payroll List Line number
Gross Pay = Days Worked * Daily Rate
Net Pay = Gross Pay - Deduction Amount
3. During Deletion, the program should ask for the Line Number to delete and update the table
Write a Javascript Program (1 HTML File) that will input an integer value n and display (upon a button click) the following:
1. The nth factorial (Using a While Loop)
2. The sum of the first n numbers (Using a Do While Loop)
3. The Average of the first n numbers (Using a For Loop)
Input the Taxable Income and Compute the income tax using the following table:
*Note: Do not use prompts for user inputs. Use the HTML input tag.
over but not over Rate
--- 250,000 0%
250,000 400,000 20% of the excess over 250,000
400,000 800,000 30,000+25% of the excess over 400,000
800,000 2,000,000 130,000+30% of the excess over 800,000
2,000,000 8,000,000 490,000+32% of the excess over 2,000,000
8,000,000 ---- 2,410,000+35% of the excess over 8,000,000
Ex)
Taxable Income Income Tax
180,000 0
320,000 14,000
520,000 60,000
930,000 169,000
2,400,000 618,000
10,000,000 3,110,000
A School District has its own internal mail. However, it can’t accept packages that
weigh more than 0.5 kg or are larger than 0.2 cubic meters. Write a program that asks the user
to input the weight of a package and its three dimensions (length, width, and height) in meters.
If the package doesn’t meet the requirements, it should say why it failed, otherwise give a
success message.