Answer to Question #269985 in HTML/JavaScript Web Application for prime

Question #269985

All test cases should be passed

Sample Input 1

true
true

Sample Output 1

Grass Trimmed
Garden Cleaned
Watered Plants

Sample Input 2

true
false

Sample Output 2

Grass Trimmed
Garden Cleaned
Water Hose Pipe Not Found

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() {

 const isGrassTrimmerFound = JSON.parse(readLine());

 const isWaterHosePipeFound = JSON.parse(readLine());

 /* Write your code here */

 const myPromise = async () => {

  try {

   /* Write your code here */  

  } catch(error) {

   /* Write your code here */ 

  }

 };

 

 myPromise();

}



1
Expert's answer
2021-11-24T07:01:18-0500
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() {
 const isGrassTrimmerFound = JSON.parse(readLine());
 const isWaterHosePipeFound = JSON.parse(readLine());
 /* Write your code here */
 const myPromise = async () => {
  try {
    if (isGrassTrimmerFound) {
      console.log("Grass Trimmed")
    else
      console.log("Grass Not Trimmed")
    console.log("Garden Cleaned")
    if (isWaterHosePipeFound)
      console.log("Watered Plants")
    else
      console.log("Water Hose Pipe Not Found")
  } catch(error) { 
  }
 };
 
 myPromise();
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS