Show Bid Request
Working with structures & I/O
Bid Request Id: 3778
|
|
|
Description:
Write a program that reads & processes a set of credit card transactions. Input file should contain 1 line per transaction (account #, trans. #, trans. amount). In function main(), define 2 arrays, data[] (of type Transaction) and accts[] (of type Account) of the length appropriate for testing the program. Use array data[] to store input data read from the file & array accts[] to store & print the table of results. Initialize account numbers in the array accts[] to: 40201, 40205, 40211, 40217. Define the struct type Transaction (long fields for account # & for trans. # & double field for trans. amount), & struct type Account(long field for account# num, double field for accumulated balance 'balance', & an integer 'count' for the # of trans. processed by the program for this account. Functions: a) inputData() with parameters for the file object, account #, trans. # & trans. amount, & an int return value; it reads 3 items from the file object into its other parameters. If the read is successful it returns 1. Otherwise it returns 0. Data should be echoed to the screen. b) printAccount() with an Account parameter; prints the account #, accumulated balance, & the count of trans. c) printTable() with the Account array & the count of valid Account elements as parameters; first, it scans the array, accumulates the # of accounts processed (by checking whether the trans count of each Account is positive) and prints the result; if the # of accounts is zero, it returns; otherwise, it prints the table header for account #, amount & # of trans., & scans the array of accounts again; if the # of trans. for an account is positive, it calls printAccount() to print the data for this account. In the input ‘do&' loop in main(), define necessary local variables, add test for overflow of the Transaction array & display message "Out of memory" & break the loop. In the search "for" loop, test whether the account # is found in the array accts[]; if found, save the trans. in array data[], increment the account balance and the # of trans. processed for this account, & break the loop. If the account # is not found in array accts[], print a message "Incorrect account" & continue input.
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
Special Conditions / Other:
I need this by Friday 10/19/01.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$50 (USD)
|
Oct 17, 2001 9:05:23 AM EDT
|
9.88
(Excellent)
|
|
|
Is this C or C++? Is this unix or windows? As soon as you accept my bid I can get started |
|
|
|
|
|