Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Define the following method: public static void printRecord(StringbookName, Stri

ID: 3611104 • Letter: D

Question

Define the following method:
  
     public static void printRecord(StringbookName, String author, int year)

    This method takes in input the name of the book,the name of the author, and the name of the year of pubblication.If invoked with "Twilight", "Meyer" and 2005, it print thisinformation on the terminal window under the following form :
              
                   Twilight by Meyer, published in 2005

In the main() method, call method printRecord() with values:
  
        Twilight Mayer   2005
         Harry Potter J.KRowling 1997


       

Explanation / Answer

import java.io.*; import java.util.*; import java.lang.*; public class Print { public static void printRecord(String bookName, String author, intyear) {    System.out.println(bookName + " by " + author +", published in " +year); } public static void main(String [] arg) {    printRecord("Twilight", "Meyer" , 2005);    System.out.println();    printRecord("Harry Potter", "J.K Rowling",1997);       }//end of main }//end of class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote