DevJourney · code I wrote while learning

README.md

File Operations

Single File Programming Question

Problem Statement

Amy is tasked with creating a program that manages book details by storing them in files.

The program should allow users to input book details such as title, author, and publisher, and then store this information in a file named sourcefile.txt. Once the details are stored, the program should copy the content from sourcefile.txt to another file named destinationfile.txt and display the copied content to the user.

Your task is to help Amy in writing the program to accomplish her task.

Input:

format :

The first line of input consists of a string representing the book's title.

The second line consists of a string representing the author's name.

The third line consists of a string representing the publisher's name.

Output:

format :

The first line prints "Book Details:"

The second line prints "Title: " followed by a string representing the book's title.

The third line prints "Author: " followed by a string representing the author's name.

The fourth line prints "Publisher: " followed by a string representing the publisher's name.

Refer to the sample output for formatting specifications.

Code constraints : The given test cases fall under the following specifications:

1 ≤ Length of the String ≤ 50

Sample test cases :

Input 1:

Java Programming
John Doe
ABC Publications
Output 1 :
Book Details:
Title: Java Programming
Author: John Doe
Publisher: ABC Publications
Input 2 :
Introduction to Algorithms
Thomas H. Cormen
MIT Press
Output 2 :
Book Details:
Title: Introduction to Algorithms
Author: Thomas H. Cormen
Publisher: MIT Press