HTML/JavaScript Web Application Answers

Questions: 680

Answers by our Experts: 648

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

The spread operator is used to:


A. replace an array with individual values

B. assign single values of an array to an variable

C. divide a number by itself

D. accept multiple values sent to a function into a single array


Product of Array Items

given array of integers, write a JS program to get the product of the integers in the given array.Input The input will be a single line containing an array integersOutput:The output should be a single line string containing the product as shown in sample outputs

Testcase1 :Sample Input 1

[1, 2, 3]

Sample Output 1

1 * 2 * 3 = 6

Testcase2 :Sample Input 2

[-1, -2, -3]

Sample Output 2

-1 * -2 * -3 = -6

note : it must satisfy any input given with different cases

"use strict";

process.stdin.resume();

process.stdin.setEncoding("utf-8");

let inputString = "";

let currentLine = 0;

process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});

process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());

 main(); });

function readLine() {

 return inputString[currentLine++]; }

function main() {

 let integers = JSON.parse(readLine());

/* Write your code here



Product of array Items

given an array integers,write JS program to get the product of the integers in the given array.

input

the input will be containing single line integers.

output

the output should be single line containing the product as shown in sample outputs.


input1

[1,2,3]

output1

[1 * 2 * 3 = 6]

input2

[-1, -2, -3]

output2

[-1*-2*-3 = -6]


Note: The Output should be displayed as [1 * 2 * 3 = 6]



Create a link button at the bottom of the webpage that would make it jump to the top of the webpage when clicked

Create a link button at the top of the webpage that would make it jump to the bottom of the webpage when clicked

ou are to develop a web application that can assist in distributing TB drugs in remote areas of Lesotho. The system should facilitate village health workers to register TB patients.  The patients should be able to log in to their accounts, view the type of medicine they are receiving, request additional medication, request a visit by the health worker and add a comment that the VHW can see.  The VHW who is resident in a given village should be able to collect medication from a clinic and deliver it to be patients. The VHW should be able to receive a report of the patient’s medication which are due for collection. These reports should be generated monthly.  The dispensary has the role of confirming the patient who should receive the treatment and should be able dispensary should be automated based on the date of enrollment.  The administrator should be able to create accounts of VHW and Dispensary roles. They should have the right to delete and update details for any use


let's build a Speed Typing Test by using the dynamic concepts of javascript


4. The Litsemba Life Insurance company computes annual policy premiums based on the age the customer turns in the calendar year. The premium is computed by taking the decade of the customer's age, adding 15 to it, and multiplying by 20. Write a Java application that prompts the user for the current year and birth year. Pass both to method that calculates and returns the premium amount and display the returned amount. Application should be saved as Insurance.java . Note: the customer age should not be more than 59 years. [10 Marks]


5. A travelling salesman records his mileage at the end of each week in order to make an accurate claim for expenses.


Write a Java code:

* With a class called Travelling which has a calculateExpenses method which is to prompt the user to input the date and the number of kilometres travelled.

* Perform a validation to ensure that the number of kilometres is an integer greater than 0.


* The method should be written within the same class:

- The first 100 kilometres is paid at R1.20 per kilometre.

- If the of kilometres is more than 100, all additional kilometres are paid at R1.50 per kilometre


* Output:

- The date : 04/28/2022

- The number of kilometres travelled: 200

- The total expenses due : R270.0


4. The Litsemba Group Life Insurance company computes annual policy premiums based on the age the customer turns in the calendar year. The premium is computed by taking the decade of the customer's age, adding 15 to it, and multiplying by 20. For example, a 34 year would pay R360 which is calculated by adding the decades (3) to 15 and multiplying by 20. Write a Java application that prompts a user for the current year and a birth year. Pass both to method that calculates and returns the premium amount and display the returned amount. Application should be named Insurance.java . Note: The customer should not be older than 59 years . [10 Marks]


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS