2018”N10ŒŽ22“ú

•½¬‚R‚O”N“x@‹ZpŽm‘æˆêŽŸŽŽŒ±–â‘è@î•ñHŠw•”–å@‡V|‚Q

‡V|‚Q
ŽŸ‚ÌJavaƒvƒƒOƒ‰ƒ€‚É—p‚¢‚ç‚ê‚Ä‚¢‚éAƒIƒuƒWƒFƒNƒgŽwŒü‹Zp‚Ì‘g‡‚¹‚Æ
‚µ‚āAÅ‚à“KØ‚È‚à‚Ì‚Í‚Ç‚ê‚©B

@public class Goods {
@ int price;
@ string name;

@ public int getPrice() {
@ @return price;
@ }
@}

@public class SaleGoods extends Goods {
@ public int getPrice() {
@ return (int) (price * 0.5);
@ }
@}

@public class Shop {
@ public int calculateAmount(Goods[] goods) {
@ int amount = 0;
@ for (int i = 0; i < goods.length; i++) {
@ @amount = amount + goods[i].getPrice();
@ }
@ return amount;
@ }
@}

@‡@@ƒI[ƒo[ƒ‰ƒCƒhAƒI[ƒo[ƒ[ƒhAƒ|ƒŠƒ‚[ƒtƒBƒYƒ€
@‡A@ƒI[ƒo[ƒ‰ƒCƒhAƒI[ƒo[ƒ[ƒhA‘½dŒp³
@‡B@ƒI[ƒo[ƒ‰ƒCƒhAƒ|ƒŠƒ‚[ƒtƒBƒYƒ€A‘½dŒp³
@‡C@ƒI[ƒo[ƒ‰ƒCƒhAƒ|ƒŠƒ‚[ƒtƒBƒYƒ€
@‡D@ƒI[ƒo[ƒ[ƒhA‘½dŒp³



“š‚¦‚Í‚±‚¿‚ç
posted by ƒtƒ@[ƒXƒgƒ}ƒNƒ at 20:08| Comment(0) | H30‹ZpŽmˆêŽŸŽŽŒ±(î•ñHŠw)