title: how to add together all doubles in a while loop, java
body: <pre><code>while (read.hasNext()) {
  
  String roomType = read.nextLine();
  int rooms = read.nextInt();
  double price = read.nextDouble();
  double roomIncome = (double) (rooms*price);
  double tax = (double) (price*rooms*defaultTax);
  double totalIncome = roomIncome;
  roomIncome++; 
  read.skip(&quot;\\s+&quot;);      
  
  
  
          
  System.out.println(&quot;Room type: &quot; + roomType + &quot; | No. of rooms: &quot; + rooms + &quot; | Room price: &quot; + price + &quot; | income: &quot; + roomIncome + &quot; | tax: &quot; + tax);
  
  System.out.println(&quot;The total room income is: &quot; + totalIncome);
  </code></pre>
  <p>I need to add together all the roomIncome's together to give a totalIncome output. Currently my output is:</p>
  <pre><code>Room type: Single | No. of rooms: 5 | Room price: 23.5 | income: 118.5 | tax: 23.5
  The total room income is: 117.5
  Room type: Double | No. of rooms: 3 | Room price: 27.5 | income: 83.5 | tax: 16.5
  The total room income is: 82.5
  Room type: Suite | No. of rooms: 2 | Room price: 50.0 | income: 101.0 | tax: 20.0
  The total room income is: 100.0
  </code></pre>
  <p>my expected output should be the total of all roomIncome added together. So in this case it should add up to 300. Instead it has added 1 to roomIncome and given me an output of 100</p>