Semester 1 Labs

                Tips!
You must write it so that it returns a string that is twice as long with every character from the original string doubled.   For instance, if the original str is "Mr. C, I find your lack of faith disturbing" the resulting String would be "MMrr..  CC,,  II  ffiinndd  yyoouurr  llaacckk  ooff  ffaaiitthh  ddiissttuurrbbiinngg" You may not use any looping structures in your solution at all.  (it must all be recursive)  Helper methods are legal, as long as they also do not include any looping structures. 

Once you are done with that you must also complete a method to calculate (approximately) a square root.  This method will need to fit the following signature:  public static int squarert(int number) {

The method will work roughly as follows, you need to count up until you find a number that when it is multiplied by itself, is larger than or equal to the original number.  (the first number that either is the perfect square root of the number, or just larger than the perfect square root).  Note:  You may not use looping for this problem, but you may use a helper tail recursive method (look at the notes in the study material for review of this) to help solve this problem.  Do not worry about negative numbers being input.

This lab is partnered and worth 4 points

Tips (in the form of questions) for this lab:

These questions can be answered by the book, and if you have them, this problem should be much easier.
Today you will write a method two different ways.  Your mission is to write methods that reverse the order of a String.  In other words if a string "garply" is given as a parameter your methods would return "ylprag".  "h" would return "h", "hi" would return "ih", and "" would return "".  You need to write this once using embedded recursion (you can look at the first solution to lab 10 for help) and once using a traditional non-recursive mechanism (using a for or while loop).  Either method should start off like this: public static String reverse(String str)
You cannot define any variables outside of your method, nor can you add parameters.  Use the examples above to help guide you towards what your base case might be. 
If you complete one of the solutions completely (according to the grading standards defined in the rubric), you can recieve 2 points.  If both are completed completely (according to the grading standards) you can recieve 4 points.  This assignment is out of 3 points, and is a partnered lab.
Do problems 6.6 & 6.7 from the book.  Note for 6.7: 32 degrees Farenheit is 273.15 degrees Kelvin, and for every 1 degree you go up of Kelvin, you go up about 1.8 degrees of Farenheit.  This is a partnered lab and worth 4 points.
Do problems 6.15, 6.37 & 6.38.  This is a partnered lab and worth 3 points.

Do the problems here on paper.  This is an individual lab, and worth 3 points.

Write a program that prompts the user to enter in the number of items to be read in by the program.  Define an array of doubles with that number of items, then prompt the user to enter in that many doubles.  Then calculate the average of that array, and then display all of the entries in the array that are larger than that average.  This is a partnered lab, and worth 3 points.
Write a method called doublearray that takes in an array of integers as a parameter, creates a new array twice the length of that array, and then copies each element into the new array twice such that if the original array is {1,2,3,4} the new one is {1,1,2,2,3,3,4,4}.  When you have doubled the array return the new one via a return statement.  The method declaration (signature) should look like this:
public static int[] doublearray(int [] foo)
This is a partnered lab, and worth 3 points.

Do the problems here on paper.  This is an individual lab, and worth 4 points.