I am working on a project in Java that requests user inputs information like name, id, score in array.I need to help about calculate a average grade that user input and how to find out who have highest score. Here is my code:  package finalproject; import java.util.Scanner; /**  *  * @author vincephng  */ public class FinalProject {      /**      * @param args the command line arguments      */      public static void main(String[] args)      {          Scanner input= new Scanner(System.in);         Cis84[] student= new Cis84[50];          int option;          for (int c = 0; c&lt;50;c++)         student[c]=new Cis84();          do{             System.out.print("");             System.out.println("1) Add Information");             System.out.println("2) Show report");             System.out.println("3) Exit");             System.out.print("\nEnter option: ");               option = input.nextInt();              switch(option)             {                 case 1:                     String n;                      double g;                     int index, i;                      System.out.println("Which position of the student?");                     index=input.nextInt();                      System.out.println("What is the student's name:");                     n=input.nextLine();                     n=input.nextLine();                      System.out.println("What is student's Id");                     i=input.nextInt();                       System.out.println("What is student's score");                     g=input.nextDouble();                      student[index].setName(n);                     student[index].setGrade(g);                     student[index].setId(i);                     break;                  case 2:                     for(int c=0; c&lt;50;c++)                     System.out.println(student[c]);                     break;                 case 3:                     System.out.println("You are done");                     break;                 default:                     System.out.println("Try again");                     break;             }          }while (option != 3);        } }      and class  package finalproject;   public class Cis84  {     private String name;     private int id;     private double grade;      public Cis84()     {         name="not input yet";         id= 00000;         grade= 0.0;     }     public Cis84(String n, int i, double g)     {        name= n;        id= i;        grade=g;     }      public void setName(String n)     {         name=n;     }     public void setId(int i)     {         id=i;     }     public void setGrade(double g)     {         grade=g;     }      public String getName()     {         return name;     }     public int getId()     {         return id;     }     public double getGrade()     {         return grade;     }      public String toString()     {         return String.format("%s\n%d\n%.2f\n", name, id, grade);     } }
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Number of ancestors 750 years ago I have 2 ancestors, a father and a mother. Two generations back - 4 ancestors. Three generations back - 8 ancestors.  30 generations back: 2^n = 2^30 = ~1,000,000,000 ancestors.  If a generation is 25 years long, 30 generations are 750 years and 30 generations ago the year was 1,267. But the world population was only 400,000,000 people so how can my math be wrong? and is there a way to estimate the number of ancestors I had 750 years ago? Right triangles and tangent lines Consider the hyperbola $xy=1$ with $x&gt;0$ and $y&gt;0.$ The tangent line at any point on the hyperbola forms a right triangle with the coordinate axes. Show that the area of the triangle does not depend on the point chosen. To show this, do the following:      a) Choose a point on the hyperbola of your choice. Find the tangent line and then find the area of the right triangle described above.      b) Choose a different point of your choice. Find the tangent line and then find the area of the right triangle described above.      c) Now for the general case, choose the point at $x=a.$ Find the tangent line at $x=a$ and then find the area of the right triangle described above.   This is the work I have so far:    No method to find the area of a right triangle was given, so I just used 1/2*B*H.  But I get stuck when given $x=a$ for part C.  Any ideas? Is the word tenfold a misnomer? I'm looking for a word that applies to all the things a person can wear, e.g. clothes, shoes, accessories, etc. It musn't be too generic, e.g. product, item, etc. How can I show that $n^2&lt;n!$ for all $n\geq 4$ Step 1 For $n=1$, the LHS=$4^2=16$ and RHS=$4!=24$. So LHS$&lt;$ RHS. Step 2 Suppose the result be true for $n=k$  i.e., $k^2&lt;k!$ Step 3 For $n=k+1$ $(k+1)^2=k^2+2k+1$ What will be the next step? How can I replace a string in a file(s)? How to find correctly the .bib file? Finding determinant for a matrix with one value on the diagonal and another everywhere else Let us look the the matrix  $\left(\begin{array}{ccccc} a &amp; b &amp; b &amp; b &amp; b\\ b &amp; a &amp; b &amp; b &amp; b\\ b &amp; b &amp; a &amp; b &amp; b\\ b &amp; b &amp; b &amp; a &amp; b\\ b &amp; b &amp; b &amp; b &amp; a \end{array}\right)$  It has one value, $a$, on the main diagonal, and another value, $b$ everywhere else. Let us assume that we are over a ring and that $a$ is invertible.  I wish to find the determinant of every $n\times n$ matrix of this form ($a$ on the diagonal, $b$ everywhere else). Using row and column operations I have managed to transform the matrix to upper-triangular form and found formula for specific cases. Generalizing it I got to the following formula:  $\det(A) = a\left(a-b\right)^{n-2}\left(a+\left(n-2\right)b-\frac{\left(n-1\right)b^{2}}{a}\right)$  I think I can prove it with row-operations in the general case with a little patience.  However, I'm wondering if there is a "smart" way of getting to this formula that I'm missing and if there is a nicer representation of it. Also, what can be said when $a$ is not invertible? (esp. the case where we are over a field and $a=0$). Prove convergence of the sequence $(z_1+z_2+\cdots + z_n)/n$ of Cesaro means May $y=e^x$ be satisfied with both $x$ and $y$ be positive integers?  I think it is not possible as $e$ ,a transcendental number, when multiplied by itself would never result in rational number.  Am I right? I entered the USA on a Visa Waiver Program (VWP) on 1 July 2012 and stayed until 16 Sep 2012 (78 days).  On what date in 2013 will I be able to travel to USA again under VWP? Should flagging a question for closure prevent close-voting? Why are bash tests so picky about whitespace? As a primarily Java programmer, I find the bash if-then construct quite confusing, especially regarding whitespace. Can anyone explain why the first one works, but not the second or third?  #works if [ -n $1 ]; then echo "parameterized"; fi  #output: ./links: Zeile 1: [-n: Kommando nicht gefunden. if [-n $1 ]; then echo "parameterized"; fi  #output: ./links: Zeile 1: [: Fehlende `]' if [ -n $1]; then echo "parameterized"; fi Vim inoremap for specific filetypes About the complex nature of the wave function? 1.  Why is the wave function complex? I've collected some layman explanations but they are incomplete and unsatisfactory. However in the book by Merzbacher in the initial few pages he provides an explanation that I need some help with: that the de Broglie wavelength and the wavelength of an elastic wave do not show similar properties under a Galilean transformation. He basically says that both are equivalent under a gauge transform and also, separately by Lorentz transforms. This, accompanied with the observation that $\psi$ is not observable, so there is no "reason for it being real". Can someone give me an intuitive prelude by what is a gauge transform and why does it give the same result as a Lorentz tranformation in a non-relativistic setting? And eventually how in this "grand scheme" the complex nature of the wave function becomes evident.. in a way that a dummy like me can understand.  2.   A wavefunction can be thought of as a scalar field (has a scalar value in every point ($r,t$) given by $\psi:\mathbb{R^3}\times \mathbb{R}\rightarrow \mathbb{C}$ and also as a ray in Hilbert space (a vector). How are these two perspectives the same (this is possibly something elementary that I am missing out, or getting confused by definitions and terminology, if that is the case I am desperate for help ;)   3.   One way I have thought about the above question is that the wave function can be equivalently written in $\psi:\mathbb{R^3}\times \mathbb{R}\rightarrow \mathbb{R}^2 $ i.e, Since a wave function is complex, the Schroedinger equation could in principle be written equivalently as coupled differential equations in two real functions which staisfy the Cauchy-Riemann conditions. ie, if $$\psi(x,t) = u(x,t) + i v(x,t)$$ and $u_x=v_t$ ; $u_t = -v_x$ and we get $$\hbar \partial_t u  = -\frac{\hbar^2}{2m} \partial_x^2v + V v$$ $$\hbar \partial_t v  = \frac{\hbar^2}{2m} \partial_x^2u - V u$$ (..in 1-D) If this is correct what are the interpretations of the $u,v$.. and why isn't it useful. (I am assuming that physical problems always have an analytic $\psi(r,t)$). Cron Job not working in plugin Do greenhouse gasses make the world habitable? An ageing gent says he does not accept this statement:  It's a fact that greenhouse gases, predominantly water vapour, keep the Earth  from being hostile and cold; that CO2 albeit in trace quantities is also a  greenhouse gas and therefore helps keep the planet warm...   I know no more about why he rejects this statement - maybe it is that water vapour alone would do the job. The gent in question has a first class degree and a doctorate in physics.    Is there a debate within the physics community over this or am I misunderstanding? PHP & MYSQL: using group by for categories Uniform convergence on two separate intervals Test the sequence of functions for uniform convergence       $$f_n(x)=\frac{nx}{1+n^2x^2}$$      $a) \text{on} \ [0,1]$      $b) \text{on} \ [1,{\infty})$   a)  If we differentiate this with respect to x we get the following :  $$(\frac{nx}{1+n^2x^2})'=\frac{n(1-n^2x^2)}{(1+n^2x^2)^2}$$  This is equal to $0$ for $x=^{+}_{-}\frac{1}{n}$  From here we can either check these two values in the original function and take the larger one as the supremum or we can find the second derivative and check whether it's negative. In either case we find that for $x=\frac{1}{n}$ we get the value $f_n(x)=\frac{1}{2}$ and for $x=-\frac{1}{n}$ we get $f_n(x)=-\frac{1}{2}$. Note that $x=-\frac{1}{n}$ doesn't even belong in our interval. Now we can finish the problem.  $$\lim_{n\to \infty}{\frac{nx}{1+n^2x^2}}=0$$  So it is piecewise converging to $f(x)=0$  $$\lim_{n\to \infty}\sup{\left \lvert{f_n(x)-f(x)}\right \rvert}=\lim_{n\to \infty}{\frac{n\frac{1}{n}}{1+n^2 \frac{1}{n^2}}}=\frac{1}{2}$$  So $f_n(x)$ does not convergence uniformly on $[0,1]$ to $f(x)=0$  b)  Now we need to test the on the interval $[1,\infty)$.From the first derivative we notice that if $x\in [1,\infty)$ then the numerator seems to be negative for all $x&gt;1$. So $f_n(x)$ is monotonically decreasing. That means that the supremum will be at the first point of the interval or $x=1$. Taking the limit :  $$\lim_{n\to \infty}{\frac{n}{1+n^2}}=0$$  We can see that the function convergences uniformly on this interval.  Is there something wrong with either of these solutions?  I'm having doubts mostly about the second interval since $x=\frac{1}{n}$ is a supremum but only for $n=1$. However I believe that we need to have the supremum that's satisfied for all $n \in N$. Pointing even the tiniest mistake in my solutions would be very helpful. Thank you. Round double to 3 points decimal