hello, i am fairly new to the programming language and i need help with the following problems dealing with files. here is the first
The data in the file that you will write will have a number that represents the number of data items and it will be followed by that number of data items – all are type int. You want to write to a file the values that exceed the average value. You may want to read in the first value and then define an array with that value., then read all of the values into an array. You will need to create a file for output. Then, you can print the values that meet the criteria into the file. When you are finished, print the program with the contents of the original file displayed as part of the program. Print the contents of the other file on a separate sheet and submit it attached to the original sheet for grading.
here is the info that goes into the actual data file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
23
16
17
8
-9
7
0
-12
9
15
-25
22
6
-9
-7
19
23
19
19
9
16
18
-19
-21
|
heres the second problem
Bank Account Problem
You will find a file that represents the transactions in a bank account for a month. The file will be laid out as follows:
Account Number – Multiple digits with dashes <<a string>>
Name of Person <<String>>
Address of Person <String>>
City, State, Zip <<String>>
Closing Date of Statement <<String>>
Opening Balance in Account <<Double>>
Multiple Lines laid out as follows:
Date D or W Amount (Where D = deposit and W = withdrawal)
Your task is to create a Bank Statement for the person that looks as follows:
Bank of Maryland
STATEMENT
Closing Date : (Closing Date from File)
Account Number : ( Account Number from File)
Name
Addresss
City, State, Zip
Opening Balance: (Display the opening balance)
Date Deposit Withdraw Current Balance
XXXXXX XXXX.XX XXXXX.XX
XXXXXX XXX.XX XXXX.XX
All deposits in the column for deposits and all withdrawals in the withdrawals. You will need to keep the current balance and print it for each transaction. In all cases, the decimals must be aligned and only 2 decimal places should be printed.
Here is the data file for this problem:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
1009-09-9180
John Q Public
1313 Mockingbird Lane
Anytown, MD 21120
March 31, 2008
1900.01
March 1 D 175.00
March 2 W 232.26
March 2 W 100.87
March 3 W 98.15
March 4 W 27.98
March 5 W 16.87
March 6 W 12.98
March 6 W 56.75
March 7 D 675.55
March 9 W 200.00
March 10 W 175.00
March 12 W 12.55
March 15 W 13.98
March 16 W 19.99
March 17 W 35.00
March 18 D 675.00
March 19 D 200.17
March 22 W 1200.99
March 23 W 18.87
March 25 W 19.99
March 27 W 18.75
March 28 W 234.00
March 28 W 175.00
March 29 W 215.34
March 30 D 399.76
March 30 W 18.90
March 31 W 26.87
|
if anyone has the answer to either of these problems id be very happy and appreciative! thanks alot!