How can one write a function for the statistics for the average of balances in a
ID: 3661592 • Letter: H
Question
How can one write a function for the statistics for the average of balances in all accounts using this struct below:typedef struct { char surName[SURNAMESIZE]; char lastName[LASTNAMESIZE]; char accNumber[ACCNUMBER]; float balance; } AccReg; AccReg initAccount(char accountNr[], char theSurName[], char theLastName[], float theBalance)/*ett konto skapas*/ { AccReg anAcc; strcpy(anAcc.accNumber,accountNr); strcpy(anAcc.surName,theSurName); strcpy(anAcc.lastName,theLastName); anAcc.balance=theBalance; return anAcc; }
Explanation / Answer
var NewStringArray = StringName.split('delimiter string')
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Dividing a delimited string
into a substring</title>
</head>
<body>
<script language="Javascript" type="text/javascript">
<!--
var DataString =
'Bob Smith,Mary Jones,Tom Roberts,Sue Baker'
var NewArray = DataString.split(',')
document.write(DataString);
document.write('<br>')
for (i=0; i<4; i++)
{
document.write(NewArray[i])
document.write('<br>')
}
-->
</script>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.