getChecked then orderPrice ONIONAMT endif endif endif

Getchecked then orderprice onionamt endif endif endif

This preview shows page 15 - 19 out of 31 pages.

if onionRadioButton.getChecked() then orderPrice = ONION_AMT * poundsTextBox.getText() endif endif endif orderAmtLabel.setText(orderPrice) screen1.remove() screen2.display() return start screen1.display() stop public void exitRoutine() screen2.remove() return 15
Programming Logic and Design, 8e Solutions 12- 8.Design the wireframes and storyboard, interactivity diagram, object dictionary, and any necessary scripts for an interactive program for clients of Larry’s Lawn Service.Allow clients to choose the size of their yard so they can be charged accordingly. For example, a lot that covers less than one-third of an acre costs $50 per service call; a lot that covers one-third to two-thirds of an acre costs $72.50 per service call; and a lot that covers more than two-thirds of an acre costs $84 per service call. Also, allow clients to choose a schedule of weekly or semiweekly lawn maintenance. After the customer clicks a Select button, display the price of the service per week. Note that semiweekly service comes with a 10 percent discount. 16
Programming Logic and Design, 8e Solutions 12- Screen 2 Interactivity Diagram Object dictionary Object name Screen number Variables affected Script? Label larryLabel 1 none none Label sizeLabel 1 none none RadioButton oneRadioButton 1 servicePrice none RadioButton oneToTwoRadioButton 1 servicePrice none RadioButton twoRadioButton 1 servicePrice none Label scheduleLabel 1 none none RadioButton weeklyRadioButton 1 servicePrice none RadioButton semiweeklyRadioButton 1 servicePrice none Button selectButton 1 servicePrice orderServiceRoutin e() Label priceLabel 2 none none Label serviceAmtLabel 2 none none Button exitButton 2 none exitRoutine() Script public void orderServiceRoutine() Declarations num ONE_AMT = 50 num ONE_TO_TWO_AMT = 72.5 num TWO_AMT = 84 17 Price of service: $84 Exit Screen 1 Screen 2
Programming Logic and Design, 8e Solutions 12- num DISCOUNT = 0.10 num servicePrice if oneRadioButton.getChecked() then servicePrice = ONE_AMT else if oneToTwoRadioButton.getChecked() then servicePrice = ONE_TO_TWO_AMT else if twoRadioButton.getChecked() then servicePrice = TWO_AMT endif endif endif if semiweeklyRadioButton.getChecked() then servicePrice = (2 * servicePrice) * (1 – DISCOUNT) endif serviceAmtLabel.setText(servicePrice) screen1.remove() screen2.display() return start screen1.display() stop public void exitRoutine() screen2.remove() return Performing Maintenance

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture