Consider a personal banking system used to record series of
expenses on customers’ bank accounts. To store the transactions, a
linked list data structure is used for each customer. Each node in
that list contains three fields: value, an unsigned integer
containing the amount being debited from the account, account_id,
an unsigned integer used to identify the other party of the
transaction (e.g. a store charging the customer for a purchase) and
next, a pointer to the next node in the list.
i) Discuss the pros and cons of using a linked list to store
these transactions instead of using an array.
ii) Write a high-level program that traverses the linked list
and calculates the total amount of money spent at one store, given
a pointer p pointing to the linked list containing transactions of
the individual, and a binary number store representing the
identification number of that store and corresponding to one of the
numbers present in the account_id field of transactions.
iii) Translate this high-level language program to a low-level
language. (The low level language contains assignment statements,
goto statements, and statements of the form if b then goto label,
where b is a Boolean expression.)
iv) Translate this low-level program to a Sigma16 program.
Consider a personal banking system used to record series of expenses on customers’ bank accounts. To store the transacti
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am