007-002-003

Class and Object: Book Information Class

Easy

Problem Description

Class and Object: Book Information Class

Learning Objective: Understand the basics of declaring a class and creating objects

Create a Book class that holds book information (title and price), create an object, and display the information.

Input

Line 1: Book title (string)
Line 2: Price (integer)

Output

Title: [title]
Price: [price] yen

Test Cases

※ Output examples follow programming industry standards

Input:
Java Programming
3500
Expected Output:
Title: Java Programming
Price: 3500 ¥
Input:
Python Basics
2800
Expected Output:
Title: Python Basics
Price: 2800 ¥
Input:
Free Tutorial
0
Expected Output:
Title: Free Tutorial
Price: 0 ¥
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 9 free executions remaining