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(); }

Struggling to find relevant content? Order a custom essay on
Rewriting a Program
Let our experts save you the hassle
Order Now
Calculate the price
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 how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
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 GPA Fix
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.
Nursing
Thank you for your help.
Customer 452707, July 5th, 2022
Philosophy
The paper is great. Will definitely use again.
Customer 452773, May 24th, 2022
Nursing
Thank you so much for being the best website for assignment help.
Customer 452635, June 24th, 2022
Human Resources Management (HRM)
The paper was delivered on time and I am very pleased with the writer's work.
Customer 452701, June 21st, 2023
Human Resources Management (HRM)
Thanks.
Customer 452701, August 1st, 2023
Human Resources Management (HRM)
great
Customer 452813, February 4th, 2024
Finance
Thank You
Customer 452643, October 24th, 2021
Nursing
Thanks
Customer 452521, May 13th, 2021
Nursing
Writer did an excellent job! Thank you.
Customer 452693, January 14th, 2022
Human Resources Management (HRM)
Thanks for your support.
Customer 452701, May 10th, 2023
nursing
Thank you!
Customer 452707, April 2nd, 2022
Social Work and Human Services
Excellent
Customer 452587, July 28th, 2021
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat

Good News ! We now help with PROCTORED EXAM. Chat with a support agent for more information