2.7.9: Quote Machine Save Submit + Continue RUN CODE TEST CASES ASSIGNMENT DOCS | GRADE MORE 5 points Status: Not Submitted 1 import java.util.Scanner; 2 3 public class QuoteMachine 4- { 5 6 public static void main(String[] args) 7 { 8 Scanner input = new Scanner(System.in); 9 10 // Ask for a quote 11 // Ask for the author 12 13 // Create a new String that has the quote in quotation marks 14 // Don't forget to escape the quotation marks 15 16 // Print the quote, then the author on the next line 17 // But you can only use ONE print statement! 18 } 19}| Write a program that asks the user for a quote and the author of the quote. Print the quote in quotation marks followed by the author on the next line. Use the escape character "\n" to create the newline rather than using separate print statements Sample Output Enter a quote: Oh the places you'll go! Enter the author of the quote: Dr. Seuss "Oh the places you'll go!" Dr. Seuss Test quotes taken from: https://www.brainyquote.com/quote_of_the_day

Respuesta :

Using the knowledge of computational language in JAVA it is possible to write a code that Write a program that asks the user for a quote and the author of the quote.

Writting the code:

import java.util.Scanner;

public class QuoteMachine

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

// Ask for a quote

System.out.println("Enter a quote: ");

String qt = input.nextLine();

// Ask for the author

System.out.println("Enter the author of the quote: ");

String aut = input.nextLine();

// Create a new String that has the quote in quotation marks

// Don't forget to escape the quotation marks

String aut_qt = "\""+ qt + "\"" + "\n" + aut;

// Print the quote, then the author on the next line

// But you can only use ONE print statement!

System.out.println(aut_qt);

}

}

See more about JAVA at brainly.com/question/18502436

#SPJ1

Ver imagen lhmarianateixeira