Skip to content
Sign upLog in

New Line

Profile icon
talynnhardy

How to start a new line? Is my coding correct so far? Please let me know.

You are viewing a single comment. View All
Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Profile icon
ObiVibKenobi

Hi there! I don’t know much java, but I do know that to print a new line, you could replace print with printf and put in %n where new lines should be. So, you could replace your code with this:

class Main { public static void main(String[] args) { System.out.printf("Enter the monthly subscription fee:"); System.out.printf("%n9.99"); System.out.printf("%nEnter the number of paying customers:"); System.out.printf("%n26000000"); System.out.printf("%nThis company makes $259740000 per month"); System.out.printf("%nThis company makes $3116880000 per year"); } }