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
Awesome work!!!!!!
Customer 452453, March 24th, 2021
Social Work and Human Services
Excellent Work!
Customer 452587, November 30th, 2021
Social Work and Human Services
Excellent!
Customer 452587, August 3rd, 2021
Social Work and Human Services
Excellent Work
Customer 452587, November 22nd, 2021
Social Work and Human Services
Excellent Work!
Customer 452587, August 24th, 2021
Technology
Great job on the paper!
Customer 452885, December 28th, 2022
Nursing
Always perfect!!! Don is the best!
Customer 452453, July 27th, 2021
Psychology
The paper is well written and professional. I highly recommend
Customer 452485, August 22nd, 2021
Classic English Literature
Nicely done. Ty. Worth every penny.
Customer 452455, June 6th, 2021
Nursing
Great work! Thank you so much.
Customer 452707, July 15th, 2022
Business and administrative studies
GREAT
Customer 452813, June 30th, 2022
Nursing
Did not receive paper on time.
Customer 452693, November 9th, 2022
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
error: Content is protected !!

Save More. Score Better. Use coupon code SPECIAL for a 15%discount