import java . io .*; import java . util .*; class Book { String name , id ; int qty ; double price , total ; Book ( String i , String n , String p , String q ) { name = n ; id = i ; qty = Integer . parseInt ( q ); price = Double . parseDouble ( p ); total = qty * price ; } public String toString () { System . out . println ( "name\t id\t qty\t price\t total" ); String s = name + "\t" + id + "\t" + qty + "\t" + price + "\t" + total ; ...
Comments
Post a Comment