Price price return public string getcakeflavor return

This preview shows page 12 - 16 out of 27 pages.

this.price = pricereturnpublic string getCakeFlavor()return cakeFlavorpublic string getIcingFlavor()return icingFlavorpublic num getDiameter()return diameterpublic num getPrice()return priceendClass
Programming Logic and Design, 9eSolutions 10-13b. Design an application that declares two Cakeobjects and sets and displays their values.
c. Design an application that declares an array of 250 Cake objects. Prompt the user for data for each of Cake, then display all the values.
Programming Logic and Design, 9e
d. Design an application that declares an array of 25 Cakeobjects. Prompt the user for a flavor, icing, and diameter for each Cake, and pass each object to a method that computes the price and returns the complete Cakeobject to the main program. Then display all the Cakevalues. An 8−inch cake is $19.99, a 9−inch cake is $22.99, and a10−inch cake is $25.99. Any other entered size is invalid and should cause the price to be set to 0.
Programming Logic and Design, 9e

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture