How does social class may or can affect the medical field?

Design a class named pizza Data fields include a string field for toppings(such as pepperoni)and numeric field?

  • for diameter in inches (such as 12) and price (such as 13.99). Include methods to get and set values for each of these fields. Create the class diagram and write the pseudocode that defines the class.

  • Answer:

    Here's Ruby code for the same: class Pizza attr_accessor :diameter, :price def initialize(d, p) @diameter = d.to_i @price = p.to_f end def display puts "Diameter: #{@diameter}, Price: #{@price} " end end puts "Enter diameter: " d = gets.chomp puts "Enter price: " p = gets.chomp p = Pizza.new(d, p) p.display

DMan at Yahoo! Answers Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.