Download as pdf
Download as pdf
You are on page 1of 3
mainepp include Teta remerpoce ot 1 2 3 4 laze Inventory Bf 6 private: 7 ane 1cennunber 8 ant quantity: a ouble coer 10 double votelcost: plies 2 Envencoryt) 3 ‘ 5 quantity = 0: 16 cost = 0 v cotelcost = 8 19 » 2 Invencory(ine newttentunber, int newQuancity, double newCose) a ‘ 2 szenllunber = newTteatuaber 2 quancity = newuencaty: 2 cost = newcost 3 secToralCostiquantity, crt) 2 2¢ quantity and cost have nay bsen inital: » 2 yous cetLtentlnber(20e) 2 i 30 ixentlunber = itenfunber; 31 » 22 void sexQuantty (srt) 33 ‘ #4 quaneity = queneity, 5 : 38 vold seccost(oubte) 37. ‘ 35 cost = cost 33 , 0 void setToralCest(int, double) at ‘ a cocalGoce = quantity * ccets 8 , “4 45 ne gecTcemunber() 46 ( 40 , 4 ant gerquantacy() so ‘ a retuenionente main.cop 3 56 3 st so 60 6 2 6 rs 6- 6 a 6 59 70 2 a % 76 7 1% 2 20 a1 2 8 es 85 86 u eo 80 %0 1 82 3 96 95 96 7 oe 9 100 103 102 103 04 return cost: ? ouble getToralcese() ‘ return totalGocr: > ant nean() ane steniunter: ant quantity: euble cece: double coraleest: cour << “Enter the Teen Numer cin >> atentunber unsle (tenfunber < 0) ‘ cout <+ “Plasce ener s positive value for che Item ter: © ‘can >> acentuaber ) cout << “Enter the Guantity of the 1¢eM ean >> queneaty: unsle (quantity < 0) f cout << “Please enter positive value for the Quantity of the 2ten: cin > quentity: ) cout << “Enter the Case of the 102m male (cost < 0) ‘ cout << "Plasce ancar = pocieive value for che Cost ot the aten: * > Inventory infernation(itenthaber, quantity, 95°) ‘ eotalcose <+ endl: endl, 100 102 103 108 105 ) ‘couble gectorelcascc) { return totalcost: ? ant nein) ant quentivy: euble cece: double totelcest: cout << “Enter the Teen Munoer cin >> atenunber’ unsle (atemunper <0) i ‘cout <+ "Plasce encer positive value Tor che ten thier ‘can >> aceanuaber ) cout << “Enter the Quantity of the trem scan >> quantity: supsie (quantaty < 0) f cout << “Plasce encer = posicive value For che Quantsty ef the Sten: " scan >> quentity: ) cour << “Enter the Cost of the scen unsle (cost < 0) ‘ cout «+ "Plasce enter s positive value for che Coet ot the aten: * can > cost; ) Inventory informsticn(itenthaber, quantity, cost) totelCost = infernation.gecTotalcost(): Atealunber = information getTcerturber() cost = anforneticn.gertost(); quantsty ~ anfornstion.geequantsey(): cout << "The Teen Numer is: * << Leemunoer << endl cout << “The Quantity is: " << quantity << endl: cour << “The coat 32+" << cone <= andl cout << “The Totel Cost is: ” << cotalCast << endl rewurn ¢ Encer che Tren tuaber: 1 Encar che Quantity of the iten: 20 Encer che Cost of the sran: 20 The Teen umber 22° 7 The Quancity 1s: 20 The Cost is. 20 ‘The Total Cost 22: 400

You might also like