Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Duplicate print lines but I only want it once

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Report post to moderator


If I have two movies, none of which are rented out, I get...
Total number of movies = 2
Of those movies 0 are currently rented out.
Total number of movies = 2
Of those movies 0 are currently rented out.

If I have three movies, the third one being rented out, I get...
Total number of movies = 3
Of those movies 0 are currently rented out.
Total number of movies = 3
Of those movies 0 are currently rented out.
Total number of movies = 3
Of those movies 1 are currently rented out.

How do I get my metod to print:
Total number of movies = 3
Of those movies 1 are currently rented out.

(Mabye I should re-think the wording of the rented out line...)
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Report post to moderator
Answered here.
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!