I need help with a program that would track information aboutpeople accounts in
ID: 3618187 • Letter: I
Question
I need help with a program that would track information aboutpeople accounts in a cable company. all inputs will come from aninput file, you can call it "info.dat", the following commandsshould be on there.P-show the previous acct bal, which is the account number andthe acct balance. C- will show the account number and the amount of paymentdue. D- shows the account number and the discount for it. M- the movie name followed by the acct number. Q-quite the transaction process. Note: the acct nums will be from 1 up to to the number ofcustomers that exist(please use an array for the customer number)the input amount shouldn't be more that $999.99. a report should beproduced, to the screen with 4 columns and headings after thetransaction is done, see below. 1-account number 2-total of all charges for that acct(monthly fees plus anyprevious balances and movie rentals. 3-the total of all credits for that acct(any credits plusdiscounts) 4-current balance of that acct(total of all charges minustotal of all credits). The program should contain a class, and one object.
Thank you guys for your support.
P-show the previous acct bal, which is the account number andthe acct balance. C- will show the account number and the amount of paymentdue. D- shows the account number and the discount for it. M- the movie name followed by the acct number. Q-quite the transaction process. Note: the acct nums will be from 1 up to to the number ofcustomers that exist(please use an array for the customer number)the input amount shouldn't be more that $999.99. a report should beproduced, to the screen with 4 columns and headings after thetransaction is done, see below. 1-account number 2-total of all charges for that acct(monthly fees plus anyprevious balances and movie rentals. 3-the total of all credits for that acct(any credits plusdiscounts) 4-current balance of that acct(total of all charges minustotal of all credits). The program should contain a class, and one object.
Thank you guys for your support.
Explanation / Answer
please rate - thanks you'll have to break it into files, and I don't understand how todo the arrays in the class, you'll have to fix this, but should getyou started #include #include class acct {private: double bal; double discounts; double credits; int movies; public: void balance(double amt) { bal=amt; } void credit(double amt) {credits+=amt; } void discount(double amt) {discounts+=amt; } void movie() {movies++; } void init() {bal=0; discounts=0; credits=0; movies=0; } bool data() {if(bal+credits+discounts+movies==0) return false; else return true; } int getmovie() {return movies; } double getdis() {return discounts; } double getcred() {return credits; } double getprev() {return bal; } }; int main() {ifstream input; char choice=0; double fee,rent,charges,cred,bal; int num,size,i; double amt; input.open("cable.dat"); //open file if(input.fail()) //is it ok? { coutsize>>fee>>rent; acct cust[size]; for(i=0;i>choice; while(choice!='Q'&&input) {input>>num; num--; switch(choice) {case 'P': input>>amt; cust[num].balance(amt); break; case 'C': input>>amt; cust[num].credit(amt); break; case 'D': input>>amt; cust[num].discount(amt); break; case 'M': cust[num].movie(); case'Q': break; } input>>choice; } input.close(); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.