SO I have an assignment for one of my classes to create an Insurance Calculator that takes in some input for ones age, level of education, marriage status, and employment status and uses this to come up with an insurance payment. The default payment is set to 100 and if an individual is younger than 22 or older than 70, the insurance is increased by 25%. If the individual has a Bachelors, the cost is reduced by 10% (20% for masters), and if the individual is married it is further decreased by 20%. If their employment status is student, cost increases 10%, but if they are unemployed it decreases 5%.  I have a huge block of code and Ive been running through it for the last few days and I seem to be stuck on my conditionals.  Currently running in two classes, one for the Individual.Class and one for the user inputs.  Individual.java:   public class Individual {     private int age;     private String ed_stat;     private String mar_stat;     private String emp_stat;     private double default_Payment = 100;      public Individual(int suns, String edu, String mar, String employ, double payments) {         this.age = suns;         this.ed_stat = edu;         this.mar_stat = mar;         this.emp_stat = employ;         this.defaultPayment = payments;     }      public int getAge() {         return this.age;     }      public String getEdu() {         return this.ed_stat;     }      public String getMar() {         return this.mar_stat;     }      public String getEmploy() {         return this.emp_stat;     }      public double getPay(){         if (22 &lt; age &gt; 70) {             default_Payment = default_Payment + (default_Payment * .25);         }         if (ed_stat == "Bachelor's") {             default_Payment = default_Payment - (default_Payment * .10);         }         if (ed_stat == "Master's") {             default_Payment = default_Payment - (default_Payment * .20);         }         if (mar_stat == "yes") {             default_Payment = default_Payment - (default_Payment * .20);         }         if (emp_stat == "Student") {             default_Payment = default_Payment + (default_Payment * .10);         }         if (emp_stat == "Unemployed") {             default_Payment = default_Payment - (default_Payment * .05);         }         return this.default_Payment;     }      public void setAge(int suns) {         this.age = suns;     }      public void setEdu(String edu) {         this.ed_stat = edu;     }      public void setMar(String mar) {         this.mar_stat = mar;     }      public void setEmploy(String employ) {         this.emp_stat = employ;     }      public void setPayment(double payments) {         this.default_Payment = payments;      }     public String toString() {         return String("Age: " + age() + ", Education : " + ed_stat + ", Marital Status: " + mar_stat + ", Employment Status: " + emp_stat + ", Payment: " + default_Payment);        } }   And the InsuranceCalculator.java  import java.util.Scanner; public class InsuranceCalculator {     public static void main(String[] args) {     double insurance = 100;     Scanner scan = new Scanner(System.in);      System.out.println("Please enter your age: ");     int years = scan.nextInt();      System.out.println("Please enter your education level as High School, Bachelor's, or Master's");     String edu = scan.next();      System.out.println("Are you married? Yes or No");     String mar = scan.next();      System.out.println("Please indicate your employment status as Unemployed, Student, or Employed");     String employ = scan.next();      Individual me = new Individual(years, edu, mar, employ, insurance);     System.out.println(me.toString());  }   Note that I have errors in the Individual.java and I can't tell how the Calculator class will run once I fix the Individual.java.  Any help is greatly appreciated, I will be working on my own as well and will update as I solve
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?
What could be the reason covid19 death data shows strong periodic trends? The covid19 death data for US shows strong periodic trends. It does not make sense to me that people die periodically.   What could be the reason to having such data? I thought it might be the reporting artifacts, for example, people always update data at Monday, but the period seems to be 3-4 days. I saw this movie a while back. I don't remember how it starts, but from where I remember watching it, it may have not been too far from the start. Apparently, Earth has been conquered by some alien empire or something and humanity are basically cavemen being used as slaves. From what I remember, the main antagonist alien is seen taking one of the slaves to a room where a machine is used on him to make him smart; this is apparently a big no-no so the main antagonist and his sidekick have to keep it quiet. The idea was that by making one of the slaves smart, it could increase the work output of the others. Apparently the antagonist is using the slaves on Earth to gather gold bullion  which is apparently still very valuable to the aliens but he's doing it illegally (not the slave labor; that's apparently ok). The protagonist who had the machine used on him becomes the intermediary between the slaves and the aliens and begins teaching the other slaves. I remember him teaching them mathematics and I remember him saying that it was universally accepted (I think he may have been referring to algebra or trigonometry). At some point he becomes aware that they are slaves and organizes a plan to free not only his fellow slaves but the Earth. Some escape and find an old museum which has old flight simulators, and shows that humanity wasn't always a slave race and that it may have been modern times in which Earth was invaded (i.e. no lasers or starships). I think they also find Fort Knox as there is a huge collection of gold bricks and weapons. The protagonist comes up with a plan to destroy some sort of teleporter the aliens use to transport stuff to and from Earth, however that alone wont be enough as they could fight back, which will be bad for humanity, which is still undeveloped. So the plan also includes using the teleporter before destroying it to to transport and detonate a nuclear warhead on the alien home world which apparently cripples any attempt to immediately send a fleet but also as a show of strength. After executing their plan, the main antagonist is captured by the humans and as an insult is locked in a cage surrounded by the gold he sought. If I recall correctly the place is set to detonate as to destroy the precocious gold and that will be used against the aliens should they mobilize a fleet in the future (i.e. attack us and we destroy Earth's supply of gold). The antagonist's side kick for some reason I remember as a big black man from whom the antagonist had removed his hand at some point and also apparently the antagonist was cruel to him. After the antagonist is locked up, he is trying to appeal to his sidekick's loyalty, however the sidekick takes the humans' side, I'm also getting an image that apart from treating him kindly the sidekick's missing hand was restored. Sorry if this is a stupid question, but I am mainly working with 5V PIC circuits and now want to integrate a component (nRF24l01+) that needs a 3.3V supply.  As I have a box full of ~7V wall-warts, I normally use a 7805 or similar LDO regulator to power the circuit. Now I want to also get 3.3V without using a separate external supply.  I'm looking for guidance on the "right" way to do this. I think the options are:   Use a voltage divider on the output of my 5V regulator to get 3.3V Use a 3.3V LDO regulator fed directly from the 7V wall-wart   Use the output of the 5V regulator as input to a 3.3V regulator   I can see that all of these would work (would they?) and that option 3 seems to waste least power, but I don't know what gotchas might arise by chaining two regulators like this.  What things do I need to consider when making this choice? Which characters are valid in CSS class names/selectors? This question is a possibly harder version of: .  Question.  Let $f,g :\mathbb R\to\mathbb R$, such that \begin{align} f(x-y)=f(x)\, g(y)-f(y)\, g(x), \tag{1}\\ g(x-y)=g(x)\, g(y)+f(x)\, f(y), \tag{2} \end{align} for all $x,y \in \mathbb{R} $. If $g$ is continuous at $x=0$ and not identically zero, then there exists an $\alpha\in\mathbb R$, such  $$ f(x)=\sin \alpha x\quad\text{and}\quad g(x)=\cos \alpha x. $$ Is there a pair of discontinuous $f$ and $g$ satisfying $(1)$ and $(2)$?  Update. If $\ell :\mathbb R\to\mathbb R$ is a linear functional over $\mathbb Q$ (i.e., $\ell(qx+ry)=q\ell(x)+r\ell(y)$, for all $x,y\in\mathbb R$ and $q,r\in\mathbb Q$), then $$ \sin\big(\ell(x)\big), \quad \cos\big(\ell(x)\big), $$ satisfy $(1)$ and $(2)$. Discontinuous such functionals do exist, and they are obtainable using Zorn's Lemma (equivalently the Axiom of Choice.) This takes care of the second question. I want to prove with mathematical induction that:  $$\sum_{i=1}^n i \cdot i! = (n+1)! - 1$$  So in the first step we define $n = 1$:  $$\sum_{i=1}^1 i \cdot i! = 1 \cdot 1! = 1 = 2! - 1$$  In the second step we define $n = n + 1$:  $$\sum_{i=1}^{n+1} i \cdot i! = \sum_{i=1}^n i \cdot i! + (n+1)(n+1)!$$ $$\implies (n+1)! - 1 + (n+1)(n+1)!$$  This can now be simplified to $(n+2)(n+1)! - 1$ but I do not see how...  We could do $(n+1)!(-1 + (n+1)) = (n+1)! \cdot n$ but still this will not be the same as above.  What did I miss?  Bodo Shape of a string/chain/cable/rope/wire? The height of a string in a gravitational field in 2-dimensions is bounded by $h(x_0)=h(x_l)=0$ (nails in the wall)  and also $\int_0^l ds= l$. ($h(0)=h(l)=0$, if you take $h$ as a function of arc length) .  What shape does it take?  My try so far: minimise potential energy of the whole string,  $$J(x,h, \dot{h})=\int_0^l gh(x) \rho \frac{ds}{l}=\frac{g \rho }{l}\int_0^l h(x) \sqrt{1+\dot{h}^2} dx$$  With the constraint  $$\int_0^l \sqrt{1+\dot{h}^2} dx- l=0$$ If it helps, it's evident that $\dot{h}(\frac{l}{2})=0$.  Generally, this kind of equation is a case of a constrained variational problem, meaning that the integrand in  $$\int_0^l \frac{g \rho }{l}h(x) \sqrt{1+\dot{h}^2} +\lambda(\int_0^l \sqrt{1+\dot{h}^2} dx- l)dx$$  Must satisfy the Euler Lagrange equation. The constraint must also be satisfied.  But, in truth, by this point I am clueless. $\lambda$ is worked through $\nabla J  = \lambda \nabla(\int_0^l \sqrt{1+\dot{h}^2} dx- l)$. I have tried this , but get nonsensical answers.  Is this method the best? If so, in what ways am I going about it wrongly thusfar? Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site? It is possible to migrate a question from one Stack Exchange site to another by closing, but if I have a question that I think is on-topic for multiple Stack Exchange sites, is it OK to post it on both (multipost)?   For example, I have a question that's earned me the tumbleweed badge on SO and I'm not sure what the best thing to do with it is. It's about a web server so it might be answerable on Server Fault but it's really more of a programming thing, hence the posting the question on Stack Overflow.    Is there any way to make the question visible on multiple sites (crosspost) and then accept the answer wherever it came from? In the book I'm study is written:     A normal subgroup of a group need not be characteristic.   And as an exercise I'm supposed to find an example, it also said that is pretty hard to find one. After trying for two days I wasn't able to find one example.   So, I'm asking for an example of a group $G$ with a normal subgroup $H$ that is not a characteristic of $G$.  I will add some context because maybe it will clarify why the book said it is difficult to find an example: the main problem with the exercise is that until it the book had only covered Group Definition, Subgroups, Lagrange's Theorem and Homomorphisms. So I'm supposed to find a example with such lack of advanced tools. How can I connect two different DC power sources together? How can I connecting two different DC power sources together? for example 15Vdc(5Amp) with 5Vdc(2Amp). I want to make one DC source (20Vdc,7Amp) by more powerful supplies. The Software Center has a section of For Purchase programs &mdash;see screenshot below&mdash;, which is annonying me every time I want to install something.  Is there any way to remove or hide these programs from the Software Center?     Links to answers:                     Please leave a comment or send a mail to jmendeth@gmail.com   if it's not working for you or you're having trouble! facing difficulty to create dynamic xpath for City field of UTest website I am beginner in automation field, I am trying to automated one of the module, I have tried many different XPATH to fetch proper XPATH for City field o UTest site. Im trying to automate registration module as one of my assignment. I have tried my different xpath example below:  //xpath="//body/div[@class='pac-container pac-logo']/div/span[2]/span" //div[@class='pac-item']/span[3] //div[@class='pac-item']/span //div[@class='pac-container pac-logo']/div/span[2]/../span[3]   the following code written:  //xpath to send data in field @FindBy(xpath="//input[@placeholder='Enter a location']") WebElement city;  //xpath for list to appear @FindBy(xpath="div[@class='pac-item']/span") List&lt;WebElement&gt; City;  public void EnterSignupTwo(String CiTy) throws Exception {     city.clear();     city.sendKeys(CiTy);     Thread.sleep(3000);     System.out.println("the size of List " +City.size());//printing list size      for(int i=0; i&lt;City.size(); i++ ) {         String cities = City.get(i).getText(); //storing list element in String         System.out.println("Converted value of city :"+cities); //print of total list      if(cities.contains(CiTy)) //if parameterized match with Available then click     {         System.out.println("enter specific value of city :"+City.get(i).getText());         City.get(i).click();         break;     } }   kindly refer the Find the equation of the plane passing through a point and a vector orthogonal I have come across this question that I need a tip for.     Find the equation (general form) of the plane passing through the point $P(3,1,6)$ that is orthogonal to the vector $v=(1,7,-2)$.   I would be able to do this if it said "parallel to the vector"  I would set the equation up as $(x,y,x) = (3,1,6) + t(1,7,-2)$ and go from there.  I don't get where I can get an orthogonal vector. Normally when I am finding an orthogonal vector I have two other vectors and do the cross product to find it.  I am thinking somehow I have to get three points on the plane, but I'm not sure how to go about doing that.  Any pointers?  thanks in advance. Why isn't temperature frame dependent? In (non-relativistic) classical physics, if the temperature of an object is proportional to the average kinetic energy ${1 \over 2} m\overline {v^{2}}$of its particles (or molecules), then shouldn't that temperature depend on the frame of reference - since $\overline {v^{2}}$ will be different in different frames?  (I.e. In the lab frame  $K_l = {1 \over 2} m\overline {v^{2}} $, but in a frame moving with velocity $u$ relative to the lab frame, $K_u =  {1 \over 2} m \overline {(v+u)^{2}}$). I have a question about my choice of name for publication.  I recently got married and legally changed my name to my husband's surname (for example's sake: from Hunter to Jones). So, despite legally being Ms Jones now, I would quite like to use the hyphenated name Hunter-Jones in the professional context and in publications. This is so that people realise that it is still me and so that I can somewhat keep my maiden name.  Is this possible or do I have to use my legal name professionally and when publishing? Thank you for any help I have a 24/7 always-on Debian Jessie based headless home server that has a large 1TB SSD for the OS and all of my frequently accessed files. This same system has 4 larger hard disk drives in a SnapRAID array. These are mainly for archiving infrequently accessed Blu-rays and want those drives to remain spun down in standby unless I actually read or write to them. They are all formatted as ext4 and mounted with noatime and nodiratime enabled.  So even though no process or program should be regularly accessing those drives in any direct way, the hard drives constantly get spun up from standby. It seems to be related to graphical programs that provide a gui file browser, even something like Chromium. If I don't even browse into those drives, I'm thinking that these processes by simply getting a list of available drives spins up the hard disks. Much like blkid does. The problem is, it's hard to determine the root cause of this since none of these processes are actually reading or writing the filesystem on those drives, so no files are actually changing or being touched. Is there some sort of cache that I can populate or a buffer to prevent these programs from spinning up the hard drive simply by getting a list of available disks? This is honestly driving me insane, since I can't find a reliably way to keep these disks spun-down even though there is no direct access of the filesystem.  UPDATE: Thanks to Stephen's answer, I was able to trace the disk activity to gvfs and udisks. It's a real shame that these processes insist on waking up disks in standby when they aren't actually being accessed to do any real I/O with the filesystem. So far I just uninstalled them, knowing that it will remove some functionality from PCManFM and the like. Why is it called John Dies at the End? The 2012 adaptation of David Wong's "John Dies at the End" ends without John dying at the end at all. While the core of the film espouses the belief that time is not linear, the word "end" suggests there is a beginning and an end to things.  Why is the movie called John Dies at the End? I have a PDF with 100 pages. How can I make a new PDF that displays 4 pages on one?  I know that I can do it with Chrome by printing the PDF to new PDF and change this in the options. But I want to make it for a lot of files and put it as a script. propositional calculus problem, how to prove this right or wrong? $A$$\rightarrow$$(B$ $\vee$ $C$ ) , $B$ $\rightarrow$ $C$ $\vDash$ $A$ $\rightarrow$ $D$  I think it's wrong but I have no idea how to prove. finding $\int_0^\infty \dfrac{dx}{1+x^4}$ through complex analysis