.NET Developer - Coding Fountains Are Installed...
.NET Developer - Coding Fountains Are Installed...
.NET Developer - Coding Fountains Are Installed...
My courses
My books My folder Career Life
home / study / engineering / computer science / computer science questions and answers / 1. .net developer - coding fountains are installed at ev…
Question: 1. .NET Developer - Coding Fountains are installed at every po… Post a question
Answers from our experts for your tough
homework questions
Enter question
Continue to post
20 questions remaining
My Textbook Solutions
Expert Answer
ANS:
CODE:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;
import java.util.stream.IntStream;
//Implementation
Homeof fountainActivation
Study tools
function
My courses
My books My folder Career Life
//with parameter as a[a[0],...a[n-1]]
List<Boolean> activate,coversWholeGarden;
int i = 0;
minFountains = max;
n = a.size();
while(i<n)
coversWholeGarden.add(false);
activate.add(false);
//increment i
i++;
i = 0;
while( i<n)
if(numberofFountains<minFountains)
minFountains = numberofFountains;
//increment the i
i++;
return minFountains;
activate.set(arrayindex, true);
List<Integer> changedState;
int min,coversGardenCount,numberofFountains,numberOfPositions;
n = a.size();
if(coverEndGarden > n)
//assing n to coverEndGarden
coverEndGarden = n;
if(coverStartGarden < 0)
//assing 0 to coverStartGarden
coverStartGarden = 0;
//assign coverStartGarden to i
i = coverStartGarden;
while(i<coverEndGarden)
//check coversWholeGarden.get(i)
Home Study tools
value
My courses
My books My folder Career Life
if(!coversWholeGarden.get(i))
coversWholeGarden.set(i, true);
changedState.add(i);
//increment the i
i++;
coversGardenCount = 0;
//initilze i with 0
i = 0;
while(i<n)
if(coversWholeGarden.get(i))
//add 1 to coversGardenCount
coversGardenCount = coversGardenCount + 1;
//increment the i
i++;
if(coversGardenCount == n)
numberOfPositions = 0;
//assign 0 to i
i = 0;
while(i<n)
if(activate.get(i))
numberOfPositions++;
//increment i
i++;
for(i= 0;i<changedState.size();i++)
coversWholeGarden.set(changedState.get(i), false);
activate.set(arrayindex, false);
return numberOfPositions;
min = max;
//initialize i with 0
i = 0;
while(i<n)
if(!activate.get(i))
if(numberofFountains<min)
min = numberofFountains;
}
}
//increment i
i++;
for(i= 0;i<changedState.size();i++)
coversWholeGarden.set(changedState.get(i), false);
Home My courses
My books My folder Career Life
activate.set(arrayindex, false);
return min;
int numberOfPositions,output;
String tempLine;
tempLine = bufferedObject1.readLine().trim();
//get the converted value of in the form of integer and assign to numberOfPositions
numberOfPositions= Integer.parseInt(tempLine);
.mapToObj(i -> {
try
return replacedline;
//handle IOException
}).map(String::trim).map(Integer::parseInt)
.collect(toList());
output = Fountain.fountainActivation(a);
//Display statement
System.out.println(String.valueOf(output));
Input:
OUTPUT:
Thank you
Q: Hello, I'm having trouble with this problem. I would prefer the
solution to either be in java or javaScript. Thank you.
Another Test Case:
Home Study tools
My courses
My books My folder Career Life
A: See answer
Q:
1. JavaServer Faces - Java View Debug Terminal Run EXPLORER V PROJECTS wy. Hi! org... In this scenario, you have to
code the hello.xhtml and its bean class named "HelloBean.java". src m... In the hello.xhtml: HelloBean.java 5 hello.xhtml x
@test.py 1 2
Show more
COMPANY
CHEGG NETWORK
CUSTOMER SERVICE