• Post Reply Bookmark Topic Watch Topic
  • New Topic

Output Question  RSS feed

 
Josh Nelbach
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All-

I have write a code that will display how many months it will take for Facebook to reach 2 billion users. We were given an example code using a compound interest formula and using a for loop. I have everything done, and as far as I can tell it works. However, when I do a system.out.print(months, totalUsers) I get a tally of months and total FB users which is cool and Im sure would pass, but I'd rather have just the output "It would take 29 months to reach 2 billion users" instead of columns. Does that make sense? Here is my code and any help would be great

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure of the issue here. You have code that works, that prints out the data that you want, but not in the format that you want. So, change the code. It is a one line change (okay, so the code line may have to move too).

Henry
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!