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
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
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
