// You now have the array string containing the dollar amounts. // Send the priceListItemsString array to BusinessClass as a parameter. BusinessClass businessClass = new BusinessClass(priceListItemsString[arrayLength]);The code in the BusinessClass is as follows:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ComputerBookStore { class BusinessClass { private static decimal totalDecimal; private static int countInteger; public BusinessClass(string[] arrayListOfPrices) { // Need to loop through string array which contains all the prices. // All book prices need to be converted to decimal and then added up. int quantityOfBooks = arrayListOfPrices.Count(); for (int i = 0; i < quantityOfBooks; i++) { totalDecimal += decimal.Parse(arrayListOfPrices[i]); } countInteger = quantityOfBooks; } public static decimal Total { get { return totalDecimal; } } public static int Count { get { return countInteger; } } } }