The program is supposed to calculate your TDEE after taking in your gender, BMR, and activity level but it can't calculate it if the activity level won't go through and I feel like it's something to do with my if-statements but I really don't know how.   The value types of gender and level used to be char but my teacher told me to change it to String but it still didn't work.  import java.util.Scanner; public class TDEE_2 {     public static void main(String [ ] args)     {         Scanner in = new Scanner(System.in);         double activityFactor = 0.0;          System.out.println("Please enter your name: ");         String firstName = in.next();         String lastName = in.nextLine();         String name = firstName + lastName;          System.out.println("Please enter your BMR: ");         double bmr = in.nextDouble();          System.out.println("Please enter your gender (M/F): ");         String gender = in.next();          System.out.println("Select Your Activity Level");         System.out.println("[A] Resting (Sleeping, Reclining)");         System.out.println("[B] Sedentary (Minimal Movement)");         System.out.println("[C] Light (Sitting, Stading)");         System.out.println("[D] Moderate (Light Manual Labor, Dacing, Riding Bike)");         System.out.println("[E] Very Active (Team Sports, Hard Manual Labor)\n");          System.out.println("Enter the letter corresponding to your activity level: ");         String level = in.next();          if(gender == "M" &amp;&amp; level == "A")             activityFactor = 1.0;         else if(gender == "M" &amp;&amp; level == "B")             activityFactor = 1.3;         else if(gender == "M" &amp;&amp; level == "C")             activityFactor = 1.6;         else if(gender == "M" &amp;&amp; level == "D")             activityFactor = 1.7;         else if(gender == "M" &amp;&amp; level == "E")             activityFactor = 2.1;         else if(gender == "M" &amp;&amp; level == "F")             activityFactor = 2.4;         else if(gender == "F" &amp;&amp; level == "A")             activityFactor = 1.0;         else if(gender == "F" &amp;&amp; level == "B")             activityFactor = 1.3;         else if(gender == "F" &amp;&amp; level == "C")             activityFactor = 1.5;         else if(gender == "F" &amp;&amp; level == "D")             activityFactor = 1.6;         else if(gender == "F" &amp;&amp; level == "E")             activityFactor = 1.9;         else if(gender == "F" &amp;&amp; level == "F")             activityFactor = 2.2;         else             System.out.println("Sorry, you entered an invalid letter.");           double tdee = bmr * activityFactor;         System.out.println("Your results:");         System.out.println("Name: " + name + "\t\t Gender: " + gender);         System.out.println("BMR: " + bmr + " calories \t\t Activity Factor: " + activityFactor);         System.out.print("TDEE: " + tdee + " calories");     }        }   When I run it, Activity level and TDEE appear empty but they're supposed to have values.  I am new to java and don't know what to do sorry
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
The scroll bar is hidden on MacBook if the user doesn't move the mouse for some time.  This pattern is also used in other devices too, for example Android devices.  The scroll bar does not take much place but it informs a user of where on page he is.  Is it a good approach hiding the scroll bar when the user is presumed viewing the content? How to get the Duke O' Death? I was watching some videos on YouTube showing how to get the Duke O' Death in GTA 5, however what I have seen is sort of unclear.  Some people say you must be a returning player on GTA 5 to get it (what does this mean too BTW?), some people don't say that. Some people say you have to be Trevor, some people don't. Some say the time of day matters, some don't. And apparently you can buy it from Warstock website (I can't).   Can someone please tell me how to get it?! GTA 5 came with my PS4 (I didn't play it on PS3) if that helps. Is it safe to connect a battery in series to wall via adapter?  I have an AC adapter which gives me 10 vDC from the wall (220 volts). I've measured the adapter and it outputs 10 vDC. I have a 3 volt battery. I would like to connect in series to get 13 vDC.   Is this possible? Is this safe? If not, what can go wrong? How can I search for bounty questions? Is there any possible way to search and list the bountied questions separately in SE? How can I report bugs with or request features for the Stack Exchange mobile apps? I'm using the official Stack Exchange mobile app for iOS or Android, and  My app crashed! It doesn't look good on my new smartphone. It won't run after I updated my device. I noticed another bug. I have an idea for a new feature which is currently not in the app.  How do I report bugs with or request features for the iOS and Android apps? Also:  I've used the built-in functionality of the app to report a bug or submit a feature request. Did I do the right thing? The app prompted me to post on Meta after an error occurred. Should I post about it here? I'm wondering why the latest version is from 2017. I've heard rumors that the apps are no longer supported; is that true? I can't find the app on my device's app store anymore! Where did it go?     We get a lot of bug reports from users about the mobile apps, which are unsupported, and at the moment, there is no centralized Q&amp;A pair for those to be closed as duplicates of (the relevant answers are spread across multiple unrelated questions). This question is an FAQ proposal, to serve as a directly-related duplicate target for those questions. In Elias Stein and Rami Shakarchi's Complex Analysis textbook, we have the following exercise:     Show that if $\{a_n\}_{n=0}^\infty$ is a sequence of complex numbers such that $$\lim_{n\to\infty}\frac{|a_{n+1}|}{|a_n|}=L,$$ then $$\lim_{n\to\infty}|a_n|^{1/n}=L.$$    I've been trying to prove this with no luck. The only thing I've thought of doing is $$\lim_{n\to\infty}\left(\frac{|a_{n+1}|^n}{|a_n|^n}\right)^{1/n},$$but this hasn't lead me anywhere except dead ends. Will someone provide a hint for me about how to proceed? Thanks!  Minor update: I don't know if it's helpful yet, but I know we can write the limit as $$\lim_{n\to\infty}\left(\frac{|a_{n+1}a_n\cdots a_0|}{|a_n\cdots a_0|}\cdot\frac{1}{|a_n|}\right).$$This reminds me a lot of the geometric mean, which even has the exponents I'm trying to get... I did a fresh install of trusty 14.04, but a lot of icons are missing. I installed from DVD which was painfully slow and I hope to avoid repeating the process, especially since I started customizing stuff.  Here's my settings window:    I've tried:  sudo apt-get install --reinstall gnome-control-center sudo apt-get install --reinstall gnome-settings-daemon-schemas   None of which changed anything.  Any idea? I wanna edit preferences and none of them are in System Settings, neither in Unity Dash. It is known that a superconductor is a material with electrical resistance zero. My question is, it is exactly zero, a theoretical zero, or for practical realistic reasons it is effectively zero? Does anyone know a SF TV short story in which there were blue men who helped "stage" our world- at least the parts we saw, on a minute by minute basis.  So, at each minute, everyone would be in the "world" that was built for that minute, then they would go on to the next "minute world".  The blue men were in the future minutes building most of reality, but only the parts that would be looked at at that minute (to save work, I think - why build something that will not every be "used")  And they were in the past tearing down all the previously lived minutes.  It was kind of a behind the scenes look at why when you set your keys down and come back to them, they aren't there. Then you look again a few minutes later and they are there. The reason in the show was that the blue men building that minute forgot to include your keys, but the next group got it right.  Years later, my wife and I still refer back to that show, so I would like to find out what it was and see if I can find a copy somewhere.  . Can someone explain Cayley's Theorem step by step? This is from Fraleigh's First Course in Abstract Algebra (page 82, Theorem 8.16) and I keep having hard time understanding its proof. I understand only until they mention the map $\lambda_x (g) = xg$. Can someone explain this proof step by step? Thank you so much! Here is the proof:  Let $G$ be a group. We show that $G$ is isomorphic to a subgroup of $S_G$. Define a one-to-one function $\phi: G \to S_G$ such that $\phi(xy)=\phi(x) \phi(y)$ for all $x,y \in G$. For $x \in G$, let $\lambda_x: G \to G$ be defined by $\lambda_x (g) = xg$ for all $g \in G$. The equation $\lambda_x (x^{-1} c) = x(x^{-1} c) = c$ for all $c \in G$ shows that $\lambda_x$ maps $G$ onto $G$. If $\lambda_x (a) = \lambda_x (b)$, then $xa=xb$ so $a=b$ by cancellation. Thus $\lambda_x$ is also one to one, and is a permutation of $G$. We now define $\phi: G \to S_G$ by defining $\phi(x) = \lambda_x$ for all $x \in G$. To show that $\phi$ is one to one, suppose that $\phi(x) = \phi(y)$. Then $\lambda_x = \lambda_y$ as functions mapping $G$ into $G$. In particular $\lambda_x (e) = \lambda_y (e)$, so $xe=ye$ and $x=y$. Thus $\phi$ is one to one. It only remains to show that $\phi(xy) = \phi(x) \phi(y)$, that is, that $\phi_{xy} = \lambda_x \lambda_y$. Now for any $g \in G$, we have $\lambda_{xy} (g) = (xy)g$. Permutation multiplication is function composition, so $(\lambda_x \lambda_y)(g) = \lambda_x (\lambda_y (g)) = \lambda_x (yg) = x(yg)$. Thus by associativity, $\lambda_{xy} = \lambda_x \lambda_y$. As far as I know, the variance inflation factor is not computed with pseudo-$R^{2}$ or generalized $R^{2}$ in binary outcome models (e.g. logistic regression).  Are there other measures of multi-colinearity than VIF appropriate to such models?  Why ought or ought not we think about multi-colinearity in such models? Is your MAC address revealed when you hit up a website? The overly simplified explanation I'm giving myself right now is  causes the opposite of what gravity does, that's why the universe is expanding. Now where gravity is a force, why dark energy is "energy"? Why it's not called "Dark Force" instead? I think I must be missing something here. Synchronizing on String objects in Java Show that the series $\sum\limits_{n=2}^{\infty} \frac {(n^3+1)^{1/3}-n}{\log n}$ converges Product Notation for Multiplication in Reverse Order Is there a standard notation for multiplication in reverse order? For example consider the problem  $$x_{k+1} = A_k x_k$$  where $x_i \in \mathbb{R}^n$ and $A_i \in M_n(\mathbb{R})$, ($i=0,1,2,\dots$) without any further assumptions on $A_i$. The solution to this problem is  $$x_k = A_{k-1} \dots A_1 A_0 x_0$$  Obviously, writing  $$x_k = \prod_{i=0}^{k-1} A_i x_0$$  is wrong because of the multiplication order. But I'm also unconfortable to use  $$x_k = \prod_{i=k-1}^{0} A_i x_0$$  as the notation suggests that we need to increment $i$, not decrement it. Also, one may need to write $\prod_{i=k}^{m} A_i$. Then, we need to explicitly state $m &lt; k$ to imply ordering.  I can always write the open form but as similar products frequently occur in calculations in my work I want to express them in a more compact way. The question is, is there a standard and nice notation to do so? There are some suggestions in , but I think none of them are "nice enough" to work with.  I came up with the notation  $$x_k = \coprod_{i=k-1}^{0} A_i x_0$$  to imply decrementing $i$ rather than increment it, but I don't know if it is used in somewhere else or there is a standard notation. Just wondering if someone can give me an explanation for this capacitor layout - what is it's function? The chip to the right is an ADC.  Circled in blue.    I'm guessing it is well known but i don't know how to search for it. Why does this function return a different value every time? Can't paste data to question, get prompted for Image? HTTPS urls don't onebox in chat When posting an HTTPS url like https://stackoverflow.com/..., it does not onebox in chat. For example: