[SOLVED] Rewriting a Program

#include #include #include using namespace std; #include “afxwin.h” #include #include “Net.h” //void printdata(CStringList& lastnamelist, double number[6][6]); //void printtotals(double totalarrays[]); void printheading(); void printreport(Net* person[]); void printhighest(Net* person[]); void getsearch(Net* person[]); void getsort(Net* person[]); void processgroup(Net* person[]); void compute(Net* person[]); #pragma unmanaged int main() { system(“cls”); system(“Color 70”); CString Connection; CDatabase database; CString username; CString password; username = “DESKTOP-LG37VVR\SQLEXPRESS\jcswa”; Connection = _T(“Driver={SQL Server Native Client 11.0};Server=DESKTOP-LG37VVR\SQLEXPRESS;Database=MonthEndBalanceSQL;Trusted_Connection=Yes;Uid=”) + username + _T(“;Pwd=”) + password + _T(“;”); database.OpenEx(Connection, CDatabase::useCursorLib); const int size = 10; Net* person[size]; int i = 0; CString query = “SELECT LastName, PreviousBalance, Payments, Charges FROM MonthendTable”; CRecordset recordset(&database); CString temp, record; recordset.Open(CRecordset::forwardOnly, query, CRecordset::readOnly); CString lastname; CStringList lastnamelist; CString spreviousBalance, spayments, scharges, snewbalance, sfinancecharge, smonthendbalance; double previousBalance, payments, charges, newbalance, financecharge, monthendbalance; //double number[6][6]; int col = 0, row = 0; while (!recordset.IsEOF()) { record = _T(“”); register int len = recordset.GetODBCFieldCount(); recordset.GetFieldValue(“LastName”, lastname); recordset.GetFieldValue(“PreviousBalance”, spreviousBalance); recordset.GetFieldValue(“Payments”, spayments); recordset.GetFieldValue(“Charges”, scharges); //lastnamelist.AddHead(lastname); col = 0; previousBalance = atof(spreviousBalance); payments = atof(spayments); charges = atof(scharges); person[i++] = new Net(lastname, previousBalance, payments, charges); row = row + 1; recordset.MoveNext(); } processgroup(person); compute(person); printheading(); printreport(person); printhighest(person); getsort(person); getsearch(person); cout << endl << endl; cout << "Program end" << endl; cin.get(); while (cin.get() != 'n'); return 0; } void processgroup(Net* person[]) { int num = Net::getcount(); Net* temp = person[0]; for (int x = 0; x < num; x++) { temp->copydatatogroup(person[x]); } } void printheading() { cout << endl << endl; cout << setw(12) << "Last Name" << setw(18) << "Previous Balance" << setw(18) << "Payments" << setw(18) << "Charges" << setw(18) << "New Balance" << setw(18) << "Finance Charge" << setw(18) << "Month End Balance" << endl; cout << endl; } void compute(Net* person[]) { int col = 0; int num = Net::getcount(); Net* object = person[0]; for (int row = 0; row < num; row++) { object->compute(person[row], row, col); } person[0]->addcolumns(); } void printreport(Net* person[]) { Net* object = person[0]; person[0]->printdata(); } void printhighest(Net* person[]) { int num; num = Net::getcount(); Net* top = person[0]; for (int st = 1; st < num; st++) { if (*top > person[st]) top = top; else top = person[st]; } cout << "nPerson with the highest month end balance: " << endl; cout << top; } void getsearch(Net* person[]) { int num, index = 0; char name[20]; CString namsearch; cout << "nEnter the name to search "; cin >> name; namsearch = (CString)name; bool found = false; num = Net::getcount(); int x = 0; while ((found != true) && (x < num)) { if (*person[x] == namsearch) { cout << person[x]; found = true; } x++; } if (found == false) cout << "Object not found " << endl; } void getsort(Net* person[]) { Net* object = person[0]; object->sortdata(); }

Don't use plagiarized sources. Get Your Custom Essay on
[SOLVED] Rewriting a Program
Get a 15% discount on this Paper
Order Essay
Quality Guaranteed

With us, you are either satisfied 100% or you get your money back-No monkey business

Check Prices
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know that being a student these days is hard. Because of this, our prices are some of the lowest on the market.

Instead, we offer perks, discounts, and free services to enhance your experience.
Sign up, place your order, and leave the rest to our professional paper writers in less than 2 minutes.
step 1
Upload assignment instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
s
Get personalized services with My Paper Support
One writer for all your papers
You can select one writer for all your papers. This option enhances the consistency in the quality of your assignments. Select your preferred writer from the list of writers who have handledf your previous assignments
Same paper from different writers
Are you ordering the same assignment for a friend? You can get the same paper from different writers. The goal is to produce 100% unique and original papers
Copy of sources used
Our homework writers will provide you with copies of sources used on your request. Just add the option when plaing your order
What our partners say about us
We appreciate every review and are always looking for ways to grow. See what other students think about our do my paper service.
Human Resources Management (HRM)
Could've been more wordage but the paper is accepatable.
Customer 452701, August 23rd, 2023
Human Resources Management (HRM)
Great Paper!
Customer 452701, August 1st, 2023
Nursing
Paid for the paper to be completed 5 days prior than the day I received the paper.
Customer 452693, July 13th, 2022
Nursing
Writer went above and beyond. Can't believe how much work they put in for the price.
Customer 452707, July 10th, 2022
Human Resources Management (HRM)
Thank you
Customer 452701, July 26th, 2023
Psychology
Excellent!!!!
Customer 452587, July 28th, 2021
Nursing
They so amazing work!!
Customer 452707, January 29th, 2023
Philosophy
The paper is great. Will definitely use again.
Customer 452773, May 24th, 2022
Other
AWESOME
Customer 452813, June 21st, 2022
Human Resources Management (HRM)
You are greatly appreciated.
Customer 452701, October 17th, 2023
Other
Excellent job
Customer 452813, December 26th, 2024
Other
GOOD
Customer 452813, July 5th, 2022
Enjoy affordable prices and lifetime discounts
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Order Now Order in Chat

Ensure originality, uphold integrity, and achieve excellence. Get FREE Turnitin AI Reports with every order.