Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ must read from .dat file and output to .ot file cScI 111 Program #4 Due October 18, 2018 In this program, we will use

C++

image text in transcribed

must read from .dat file and output to .ot file

cScI 111 Program #4 Due October 18, 2018 In this program, we will use parallel arrays to store and manipulate our data. A&B Variety is a small store in a small town, selling a variety of trinkets and gifts. The store allows customers to have credit accounts. Each month, the store prints a report showing the charges payments, prior balance, and new balance for each customer. Arrays to be declared include first (string), last (string), id (integer), oldbalance (double), newbalance (double). purchases (double), and payments(double) using a maximum size of 100. Be sure to write and call an initem function to initialize all arrays and to set numc to zero. Write a program to do the following A) Call a function to read the customer identification numbers, first name, last name, old balance, purchases, and payments for each customer. Calculate numc, the number of customers read in. B) Call a function to determine the new balance for each customer, storing the results in the array created for that purpose. C) Write function gettotal, which will determine the total for an array of doubles. Call this several times, once each to determine the total for oldbalance, newbalance, payments, and purchases for the month. D) Call a function to sort the arrays into ascending order based upon the customer's last name E) Print the sorted arrays in tabular form. You should also output the column totals under the appropriate columns. Here's the input data: Old d First Last Balance Payments Purchases 1234 Sami Colunga $385.22 $75.00 $50.00 2345 Tom 3456 Manual Martinez 4567 Alec Adams $385.22 $250.00 $25.49 5005 Han Solo $1,705.55 $10.00 $1,199.99 5678 Betty Boop 6789 Callie Calendar 0.00 $75.00 $75.00 7025 Ed 7890 Darlene Dawkins $38.65 $100.00 $78.90 8901 Lenny Lefkowicz $792.25 $250.00 $0.00 012 Will Wilson $23.58 $10.00 $150.00 Johnson $29.95 $25.00 $0.00 $0.00$0.00$28.00 $69.95 $39.00 $20.11 Burkett $100.00 $100.00 $100.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions