### [Solved] Rash is known about his love for racing sports. He is an avid Formula 1 fan

I need a java code for this problem.

Rash is known about his love for racing sports. He is an avid Formula *1* fan. He went to watch this year’s Indian Grand Prix at New Delhi. He noticed that one segment of the circuit was a long straight road. It was impossible for a car to overtake other cars on this segment. Therefore, a car had to lower down its speed if there was a slower car in front of it. While watching the race, Rash started to wonder how many cars were moving at their maximum speed. Formally, you’re given the maximum speed of *N* cars in the order they entered the long straight segment of the circuit. Each car will prefers to move at its maximum speed. If that’s not possible because of the front car being slow, it might have to lower its speed. It still moves at the fastest possible speed while avoiding any collisions. For the purpose of this problem, you can assume that the straight segment is infinitely long. Count the number of cars which were moving at their maximum speed on the straight segment.

Input

The first line of the input contains a single integer *T* denoting the number of test cases to follow. Description of each test case contains *2* lines. The first of these lines contain a single integer *N*, the number of cars. The second line contains *N* space separated integers, denoting the maximum speed of the cars in the order they entered the long straight segment.

Output

For each test case, output a single line containing the number of cars which were moving at their maximum speed on the segment.

Constraints

1≤T≤100

1≤N≤105

1≤speed≤109

SAMPLE INPUT

3 1 10 3 8 3 6 5 4 5 1 2 3

SAMPLE OUTPUT

1 2 2

**Expert Answer**

CODE :-

import java.util.Scanner;

public class Race

{

public static void main(String[] args)

{

Scanner…

### [Solved] There are N houses (numbered from 0 to N-1) in the Green District

There are N houses (numbered from 0 to N-1) in the Green District. Until now, all of the houses have been using energy from the power plant. The energy demand of the K-th house is A[K] units. The residents of the Green District have decided that they should switch to renewable energy sources and want the total demand for energy from the power plant in the district to become non-positive. In other words, the sum of energy demands over all houses should become less than or equal to zero. For this purpose they are going to install solar panels on the roofs of some of the houses. One of two types of solar panels can be installed on each of the houses: • The first type costs X. Installing this type on a house generates the exact amount of energy that the house demands. After the installation, the house does not need to draw energy from the power plant anymore (its energy demand becomes 0). • The second type casts Y. It generates twice as much energy as the house demands. The surplus is transferred into the network and can be used by other houses inside the district. It means that after installing this type of panel on the roof of the K-th house, instead of having an A[K] energy demand, the house produces A[K] energy (which is the equivalent of having a -A[K] energy demand).

2. Given A = [4, 2, 7]X = 4 and Y = 100, the function should return 12. We can install a solar panel of the first type on each of the houses, therefore reducing their energy demand to 0. The total cost of the installations is 4 + 4 + 4 = 12. After these three installations, the total energy demand is equal to 0 as A = [0, 0, 0). 3. Given A = [2,2,1,2,2), X = 2 and Y = 3, the function should return 8. Non-positive power plant energy demand can be achieved with three installations: a solar panel of the second type on A[1]. changing its demand from 2 to a production of 2 for a cost of 3, a solar panel of the second type on A[3], changing its demand from 2 to a production of 2 for a cost of 3 and a solar panel of the first type on A[4], reducing its demand from 2 to 0 for a cost of 2. The total cost of the installations is 3 + 3 + 2 = 8. After these three installations, the total energy demand is equal to -1 as A = 12,-2, 1, -2,0). 4. Given A = [4, 1, 5, 3), X = 5 and Y = 2, the function should return 4. Non-positive power plant energy demand can be achieved by installing two solar panels of the second type: one on A[O] and one on A[3]. The total cost of the installations is 2 + 2 = 4. After these two installations, the total energy demand is equal to -1 as A = (-4, 1 5,-3).

The cost of installation of each kind of solar panels is the same for all houses. What is the minimum cost to make the total demand for power plant energy in the district non-positive? Write a function: class Solution { public int solution(int[] A, int x, int Y); } that, given an array A of Nintegers, denoting the energy demand for each of the houses, an integer X and an integer Y, returns the minimum cast to make the total demand for power plant energy in the Green District non-positive. Examples: 1. Given A = [5, 3, 8, 3, 2], X = 2 and Y = 5, the function should return 7. Non-positive power plant demand can be achieved by installing two solar panels: A panel of the first type on house number 0, which will reduce the demand of A[0] from 5 to 0 for a cost of 2, and a panel of the second type on A[2], changing its demand of 8 to a production of 8 units for a cost of 5. The total cost of the installations is 2 + 5 = 7. After these two installations, the total energy demand is equal to 0 = 0 + 3-8 +3 + 2).

**Expert Answer**

### [Solved] A homeowner is travelling overseas long-term and wants to rent out his house

A homeowner is travelling overseas long-term and wants to rent out his house. A local management company advises the home-owner that average rental income for houses like his in this area, i.e. 3 bedroom semi-detached town house, is no more than 770 euro. The homeowner thinks that it is more than this. He notices a report in the local paper in which a random sample of 13 rental properties of this type, in this area, gave an average of 871.51 euro with a standard deviation of 82.74 euro. Is this evidence that the average rental income of houses of this type in this area is greater than 770 euro? To answer this, test the following hypotheses at significance level α = 0.05

H_{0}: μ = 770

H_{a}: μ > 770.

**Complete the test by filling in the blanks in the following:**

An estimate of the population mean is .

The standard error is .

The distribution is *(examples: normal / t12 / chisquare4 / F5,6).*

The test statistic has value TS=.

Testing at significance level α = 0.05, the rejection region is:

*(less/greater)* than *(2 dec places).*

Since the test statistic *(is in/is not in)* the rejection region, there *(is evidence/is no evidence)* to reject the null hypothesis, H_{0}.

There *(is sufficient/is insufficient)* evidence to suggest that average rental income for houses like his in this area, i.e. 3 bedroom semi-detached town house, μ, is greater than 770 euro.

**Were any assumptions required in order for this inference to be valid?**

a: No – the Central Limit Theorem applies, which states the sampling distribution is normal for any population distribution.

b: Yes – the population distribution must be normally distributed.

Insert your choice *(a or b)*: .

**Expert Answer**

….

### (Solved) A healthy concentration of LDL cholesterol falls in the range of 100-130 mg dL-1

A healthy concentration of LDL cholesterol falls in the range of 100-130 mg dL^{-1}. A doctor might prescribe a statin if a person’s concentration of LDL cholesterol reaches 190 mg dL^{-1}. Given these guidelines, your goal is to determine the dosage of the drug needed to decrease the concentration of LDL cholesterol by -60 mg dL^{-1}.

**Directions:** Use the path model in Figure 2 to answer question 17. Round all calculated values to the nearest tenths of a decimal place. For example, if you calculate the value as 3.821853, round to 3.8.

What dosage of the drug (mg/d) must be administered to reduce LDL cholesterol in the blood by 60 mg dL^{-1}? *As a note, the drug has no effect on LDL cholesterol in the body at dosages of 4.0 mg d*^{-1}* or less, so be sure to add 4.0 mg d*^{-1}* to your final answer.*

Dosage of drug (mg/d) =

**Expert Answer**

### [Solved] A ball with a mass of m 0.75 kg is attached to a spring with a spring constant of k 2000 N/m and swung around in a vertical circle

Problem 3

A ball with a mass of m 0.75 kg is attached to a spring with a spring constant of k 2000 N/m and swung around in a vertical circle. When the spring is unstretched it has a length Io= 5 cm. When the ball is at the bottom of the circle, the spring is stretched to a length of 1 1 Find: The speed of the ball at the bottom of the circle. k- 2000 N/m 1-10 cm Cim m 0.75 kg

**Expert Answer**

Answer to A ball with a mass of m 0.75 kg is attached to a spring with a spring constant of k 2000 N/m and swung around in a vertical circle….

### [Solved] Write a program children.c, and let the parent process produce two child processes

Write a program children.c, and let the parent process produce two child processes. One prints out “I am child one, my pid i ” PID, and the other prints out “I am child two, my pid is: “PID. Guarantee that the parent terminates after the children terminate (Note, you need to wait for two child processes here). Use the getpid() function to retrieve the PID

**Expert Answer**

**Code:**

#include <stdio.h>

int main() {

int fork1 = fork();

if (fork1 < 0) {

### [Solved] The jet velocity in a Pelton turbine is 65 m/sec. The peripheral velocity of the runner is 25 m/sec.

The jet velocity in a Pelton turbine is 65 m/sec. The peripheral velocity of the runner is 25 m/sec. the jet is deflected by 160° by the bucket. Determine the power developed and hydraulic efficiency of the turbine for a flow rate of 0.9 m/sec, the blade friction coefficient is 0.9 and what the exit loss of power.

**Expert Answer**

Answer to The jet velocity in a Pelton turbine is 65 m/sec. The peripheral velocity of the runner is 25 m/sec…..

### [Solved] Methods/functions Write a method that prints “Methods are my friend!”

**Methods/functions **

- Write a method that prints “Methods are my friend!”
- Write a method that takes in a number as a parameter and, based on that number, prints out “Methods are my friend” that number of times.
- Write a method that takes in a letter and returns whether or not that letter is a vowel.
- Write a method that takes in a number that represents a high school GPA and determines if that value is greater than 3.0
- Write a method that takes in the age of a person and prints out (not returns) whether they are over 65 years of age.
- Write a method that takes in the age of a person and returns the number of “Dog years” they are. For this, the persons age will be divided by 7.

**Expert Answer**

**i) Write a method that prints “Methods are my friend!”**

**CODE:**

public class first {//the method.....