Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

home / study / engineering / computer science / computer science questions and answers / i'm trying to write a program that reads in struct,

home / study / engineering / computer science / computer science questions and answers / i'm trying to write a program that reads in struct, ... Question: I'm trying to write a program that reads in i'm trying to write a program that reads in struct,(3 bookmarks)

Each line of the data file begins with an 'e', 'c', or 't'. Lines beginning with 'e' will have an integer employee ID and an employee name.

Lines beginning with 'c' will have an integer customer ID, customer name, and a floating point account balance.

Lines beginning with a 't' will have a customer ID, employee ID, a 'w' or 'd' representing withdrawal or deposit, and a floating point transaction amount.

Lines beginning with an 'e' and 'c' may be intermingled, but all 'e' and 'c' lines will come before lines beginning with 't'.

There will be at most 50 employees and 50 customers, and an unknown number of transactions.

Names will be at most 15 characters long. data are: e 5 Elden

c 3 Felipe 55342.51415

e 3 Leonardo e 1 Yong

c 9 Alessandra 8114.541862

c 6 Marnie 15287.78233

e 8 Kourtney c 2 Lou 95053.44742

c 5 Numbers 51245.66138

e 4 Jarvis e 9 Marlen

e 10 Florance

c 1 Devon 56442.27875

e 2 Elliott

c 8 Justina 73723.84849

c 10 Reyna 82946.53205

e 6 Antonetta e 7 Florene

c 4 Merrill 98281.82784

c 7 Marlana 33252.21805

t 1 8 w 4924.86

t 9 6 d 3220.42

t 6 1 w 127.62

t 9 8 w 5566.7

t 9 8 d 5414.55

t 5 7 w 9422.35

t 9 10 d 1382.07

t 4 7 d 6131.07

t 8 2 w 2362.22

t 8 10 d 5834.48

t 5 4 w 5150.73

t 6 2 d 3795.96

t 1 9 w 3919.45

t 5 2 w 5037.31

t 3 9 w 8129.21

t 8 6 d 1235.67

t 2 4 d 6901.28

t 8 10 d 5599.44

t 6 9 d 1936.16

t 7 9 d 7363.98

program should read in the employee and customer information and update the customer account balance depending on the transaction. For example, t 1 8 w 4924.86 means to update the balance for customer 1 by withdrawing 4924.86 from Devon's account balance of 56442.27875. For each transaction, output customer name, the employee name, a plus sign for deposit or a minus sign for withdrawal, the transaction amount, and the new balance after the transaction with two decimal places thanks in advance for any help

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

Students also viewed these Databases questions

Question

Know how productivity improvements impact quality and value.

Answered: 1 week ago

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago