Reference no: EM13691692
Question 1) Write a method called sigma that takes an int parameter n and returns the sum of all the integers from 1 to n (inclusive). For example, sigma(4) should return 10.
Question 2) Write a method called distance that takes four double parameters, x1, y1, x2 and y2. x1 and y1 are the coordinates of the first point; x2 and y2 are the coordinates of the second point. The method should return the distance between the two points. Use the Pythagorean theorem.
Question 3) The hailstone sequence begins with some designated integer n (it can be any integer). If n is even, then the next number in the sequence is n/2. If n is odd, then the next number in the sequence is 3 * n + 1.
Write a method called hailstone that takes an int parameter that gives the starting place. The method should return the number of steps that it takes until the sequence arrives at 1. For example: if the method is called with 3 as the parameter, then the sequence would be 3, 10, 5, 16, 8, 4, 2, 1. It takes 7 steps to get from 3 to 1, so the method would return 7.
Please show me all the work and provide me the code.
Is it likely that both ring connections are mad
: Problem- Is it likely that both ring connections are mad simultaneously in this experiment (Miniscale synthesis of a substituted pyrimidine) as was observed for the diels-alder synthesis
|
What prymidine would be expected as the product starting
: Problem- What prymidine would be expected as the product starting with acetamidine and diethyl malonate? with urea and 2,4-pentanedione. Depict your all calculation in detail so I can understand the solution thoroughly
|
Calculates the average of numbers
: Write a C program which takes n number of element from user (where, n is specified by user), stores data in an array and calculates the average of those numbers. Output of the program should look like this;
|
How many moles of strong base were initially added
: Assume that the volume remains constant when the base is added. when the reaction is complete, what is the concentration ratio of conjugate base to acid. How many moles of strong base were initially added
|
Write a method called sigma
: Write a method called sigma that takes an int parameter n and returns the sum of all the integers from 1 to n (inclusive). For example, sigma(4) should return 10.
|
Calculate the change in internal energy
: Calculate the change in internal energy of the following system: a 100.0-g bar of gold is heated from 25 ?C to 50 ?C during which it absorbs 322 J of heat. Assume the volume of the gold bar remains constant.
|
List the six steps in the problem solving methodology
: List the six steps in the problem solving methodology described in the text to be applied to computer programming assignments?
|
Calculate the number of joules in a btu
: Problem- The use of the British thermal unit (Btu) is common in much engineering work. ABtu is the amount of heat required to raise the temperature of 1 lb of water by 1?F. Calculate the number of joules in a Btu.
|
What mass of naoh is needed to precipitate the cd2+ ions
: Problem- What mass of NaOH is needed to precipitate the Cd2+ ions from 34.0mL of 0.510M Cd(NO3)2 solution
|