write Java code
FAMOUS QUOTES PROGRAM - Write a program that displays the following information in the EXACT pattern/formatting shown below. You must use escape sequences to do this - this is not English class and things are written below to test you on escape sequences form class, so no matter what follow the pattern/formatting shown (the dashes and spaces do not have to be perfect but everything else should match, you should try to use tabs for the spacing - in addition you don't know how to program "bold" so you can ignore the bold).
Famous Person
Profession Famous
Quote
------------- ----------- -------------
William Shakespeare
Playwright\Poet "Listen to many,
speak to a few."
Abraham
Lincoln
President
"A house divided against itself cannot stand."
Renee
Descartes
Mathematician "Everything
is self-evident."
CODE:
public class Main { public static void main(String[] args) { //storing the details in three different arrays String[] person = {"William Shakespeare","Abraham Lincoln","Renee Descartes"}; String[] profession = {"Playwright/Poet","President","Mathematician"}; String[] quotes = {"Listen to many, speak to a few","A house divided against itself cannot stand","Everything is self-dividend"}; //printing using escape sequences System.out.println("Famous Person\t\t\tProfession\t\t\tFamous Quotes"); System.out.println("-------------\t\t\t----------\t\t\t-------------"); for(int i=0;i<3;i++){ System.out.println(person[i]+"\t\t\t"+profession[i]+"\t\t\t"+quotes[i]); } } }
_____________________________________________
CODE IMAGE:
_____________________________________
OUTPUT:
____________________________________________
Feel free to ask any questions in the comment section
Thank You!
Get Answers For Free
Most questions answered within 1 hours.