Value on left must represent an address not valid n

This preview shows page 7 - 14 out of 49 pages.

// value on left must represent an addressNot Valid -n. productName = brush// string constant must appear within quotesNot Valid - o. battery = productName// value on left is not a declared variableNot Valid -p. productPrice = productPrice// numeric variables can only contain digits Valid -q. productName = productCost
3.Assume that income = 8 and expense = 6. What is the value of each of the following expressions?a.income + expense * 220b.income + 4 − expense / 29c.(income + expense) * 228d.income − 3 * 2 + expense8e.4 * ((income − expense) + 2) + 1026
4.Draw a typical hierarchy chart for a program that produces a monthly bill for a cell phone customer. Try to think of at least 10 separate modules that might be included. For example,one module might calculate the charge for daytime phone minutes used.PREPARECUSTOMER’SMONTHLY BILLWRITE HEADINGLINEREAD CUSTOMERFILEPROCESSCUSTOMER FILEWRITE MONTHLYTOTALSREAD CUSTOMERFILEWRITE DETAILLINECOMPUTEINDIVIDUAL BILLINCREMENTMONTH TOTALSCOMPUTE BILLCOMPUTE DATAUSEDCOMPUTEMINUTES USEDCOMPUTECOMPANY FEE
5.a. Draw the hierarchy chart and then plan the logic for a program needed by the sales manager of The Henry Used Car Dealership. The program will determine the profit on any car
startDeclarationsnum salePricenum purchasePricenum profitstring SALE_PROMPT = “Enter the sale price: ”string PURCHASE_PROMPT = “Enter the purchase price: ”string END_LINE = “Thanks for using this program”housekeeping()detail()endOfJob()stophousekeeping()output SALE_PROMPTinput salePricereturndetail()output PURCHASE_PROMPTinput purchasePromptprofit = salePrice - purchasePriceoutput profitreturnendOfJob()output END_LINEreturn
detailLoop()Housekeeping()StartOutput

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture