-->
当前位置:首页 > 题库

PROGRAMMING:Declare the book class, record the total number of books, use the static variable assignment.

Luz5年前 (2021-05-10)题库426
Declare a Book class, whose data members are book name, number (using static variables to realize automatic numbering) and book price, and have the number of copies of static data members to record the total number of books; In the construction method, the static variable is used to assign the number of the object, the object array is defined in the main method, and the total number of copies is calculated.
###Output format:
Please output the title, number, price and total number of books corresponding to each book.
###Output example:
```out
Title: Java programming, book number: 1, price: 34.5
Book title: data structure, book number: 2, book price: 44.8
Title: C + + programming, book number: 3, book price: 35.0
The total number of books is: 3
```






answer:If there is no answer, please comment