Home storing multiple data in class and caluclate
Reply: 0

storing multiple data in class and caluclate

Sashi Kumar
1#
Sashi Kumar Published in 2018-01-04 12:34:52Z

Here is the question: Your task is to modify the program above so that it will continue to execute asking for items as input until the user enters ‘Q’ to quit. You only need one instance from the Purchase class but additional/different variables may be required to maintain a running total. Perform the same calculations as before but this time also calculate a running total for the number of items purchased and the grand total for the amount to be paid.

The final GRANDTOTAL section prints out the total number of items purchased and the total amount to be paid. This will require a new print member function in class Purchase (you can call it printtotal()).

This is what I done soo far https://gist.github.com/anonymous/b7d281e5f2dc8b2aa1b17d909fee58e4 this is how the output should be : https://imgur.com/a/CpThL
and my output is : https://imgur.com/a/msYBE

Somehow the first data is not saved into the class. I like to know how to save multiple data in the class and calculate the total

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30308 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO