TutorMe homepage
Subjects
PRICING
COURSES
Start Free Trial
William A.
Math, Science, and Computers
Tutor Satisfaction Guarantee
Java Programming
TutorMe
Question:

Write a line of Java code that creates an ArrayList with the generic parameter of String.

William A.

To begin to write this code, we must know what it is asking us to do. ArrayList is an object and objects are created using a line such as: Object<E> objectName = new Object<>(); Here the 'new' statement creates a new instance of object with the object name 'objectName'. The <E> in the line is the generic parameter. This tells the compiler what kind of objects will be used. The question has asked us to use String as a generic parameter, so we can rewrite this as <String>. Using all of this information we can simply replace the line of code above with the information we have been given to obtain: ArrayList<String> objectName = new ArrayList<>();

Chemistry
TutorMe
Question:

Find the products and balance the combustion reaction: $$CH_4 + O_2$$

William A.

1. To begin to find the products of this reaction, we must first know that the products of a combustion reaction are water and carbon dioxide or: $$H_2O$$ and $$CO_2$$ The reaction can now be written as: $$CH_4 + O_2 \rightarrow H_2O + CO_2$$ 2. Now that we have the products of the reaction, we can move to balancing it. To balance a chemical reaction we must put the appropriate coefficients in front of each compound. We will rewrite the reaction as so: _$$CH_4 +$$ _$$O_2 \rightarrow$$ _$$H_2O +$$ _$$CO_2$$ We need to fill in the blanks with the appropriate coefficients to balance the reaction. 3. Looking first at the C or Carbon on each side we see that both sides already have one C, so we can fill in the blanks with 1, as so: $$1CH_4 +$$ _$$O_2 \rightarrow$$ _$$H_2O +$$ $$1CO_2$$ 4. We now move on to the H or Hydrogen and we see that on the left side of the arrow we have $$1CH_4$$. To break this down, the subscript $$_4$$ on the $$H_4$$ indicates that there are four hydrogens. We must also multiply the 4 by the coefficient of 1: $$H_{4*1} = H_4$$ On the other side of the arrow we have two hydrogens in $$H_2O$$. To find the coefficient for $$H_2O$$ we can balance the hydrogens using the equation: $$H_4 = H_{2*x}$$ We can see that x = 2 and this is the coefficient needed for water, so our reaction becomes: $$1CH_4 +$$ _$$O_2 \rightarrow 2H_2O +$$ $$1CO_2$$ 5. Finally we move to $$O_2$$ or Oxygen. We see that we have two oxygen on the left side of the arrow and we have two different compounds with oxygen on the right side. For $$2H_2O$$ we have: $$O_{1*2} = O_2$$ and for $$1CO_2$$ we have: $$O_{2*1} = O_2$$ We can now create an equation for both sides of the reaction: $$O_{2*x} = O_2 + O_2 = O_4$$ We see that x = 2 and this is the coefficient for $$O_2$$, so our final balanced reaction is: $$1CH_4 + 2O_2 \rightarrow 2H_2O +$$ $$1CO_2$$

Algebra
TutorMe
Question:

Find the solutions to the quadratic equation: $$f(x) = x^2 + 5x + 6$$

William A.

1. To begin to find the solution to a quadratic equation, we must first set the equation equal to zero, as such: $$x^2 + 5x + 6 = 0$$ This essentially means that we are looking for places where the corresponding y-value is equal to zero, also known as an x-intercept. 2. We then must factor the quadratic equation. We start by using a general form of the quadratic equation, $$ax^2 + bx + c$$, where in this case b = +5 and c = +6. We now look for pairs of numbers that add to make b and multiply to make c. We quickly find that the pair is (+2, +3). 3. We can now rewrite the quadratic equation from (1) as: $$(x + 2)(x + 3) = 0$$ This is the factored form of the equation using the pairs we found in (2). 4. The last step for finding the solutions to the quadratic equation is to set both (x + 2) and (x + 3) equal to zero: $( x + 2 = 0 \\x + 3 = 0$) After solving both equations we find that the solutions are x = -2 and x = -3, which are also called the x-intercepts of the quadratic equation.

Send a message explaining your
needs and William will reply soon.
Contact William