1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OlgaM077 [116]
2 years ago
6

Design a class named Cake. Data fields include two string fields for cake flavor and icing flavor and numeric fields for diamete

r in inches and price. Include methods to get and set values for each of these fields. Create the class diagram and write the pseudocode that defines the class. Design an application that declares two Cake objects and sets and displays their values.
Computers and Technology
1 answer:
kkurt [141]2 years ago
5 0

Using the computer language in pseudocode to write a function code that  declares two Cake objects and sets and displays their values.

<h3>Writting the code in pseudocode:</h3>

<em>- cake flavor: string</em>

<em>- icing flavor: string</em>

<em>-diameter: num</em>

<em>-price: num</em>

<em>+set cake flavor (cake flavor : string) : void</em>

<em>+set icing flavor (icing flavor: string) : void</em>

<em>+set Diameter(size : num) : void</em>

<em>+set Price(price : num) : void</em>

<em>+get cake flavor () : string</em>

<em>+get cing flavor () : string</em>

<em>+get Diameter() : num</em>

<em>+get Price() : num</em>

<em>Answer A=</em>

<em>Pseudocode:</em>

<em>class Cake</em>

<em>Declarations</em>

<em>private string cake flavour</em>

<em>private string icing flavor</em>

<em>private num diameter</em>

<em>private num price</em>

<em>public void set Cake flavour (string Cake flavour)this. Cake flavour = Cake flavour</em>

<em>return</em>

<em>public void set icing flavour (string icing flavour)this. icing flavour = icing flavour</em>

<em>return</em>

<em>public void set Diameter(num size)</em>

<em>diameter = size</em>

<em>return</em>

<em>public void set Price(num price)</em>

<em>this price = price</em>

<em>return</em>

<em>public string get Cake flavour ()</em>

<em>return Cake flavour</em>

<em>public string get icing flavour ()</em>

<em>return icing flavour</em>

<em>public num get Diameter()</em>

<em>return diameter</em>

<em>public num get Price()</em>

<em>return price</em>

<em>end Class</em>

<em>start</em>

<em>Declarations</em>

<em>Cake my Cake</em>

<em>Cake your Cake</em>

<em>myCake.set cake flavour (“chocalate”)</em>

<em>myCake.set icing flavour (“peppermint”)</em>

<em>myCake.setDiameter(15)</em>

<em>myCake.setPrice(18)</em>

<em>myCake.set cake flavour (“pineapple”)</em>

<em>myCake.set icing flavour (“orange ”)</em>

<em>yourCake.setDiameter(20)</em>

<em>yourCake.setPrice(25)</em>

<em>output “Cake 1 info:”</em>

<em>output myCake.get cake flavour ()</em>

<em>output myCake.get icing flavour ()</em>

<em>output myCake.getDiameter()</em>

<em>output myCake.getPrice()</em>

<em>output Cake 2 info:”</em>

<em>output yourCake.get cake flavour ()</em>

<em>output yourCake.get icing flavour ()</em>

<em>output yourCake.getDiameter()</em>

<em>output yourCake.getPrice()stop</em>

See more about pseudocode at brainly.com/question/13208346

#SPJ1

You might be interested in
How to recover permanently deleted files from drive
HACTEHA [7]
Go into your trash bin in your computer.
7 0
3 years ago
Construct a formula in cell D11 to calculate the sales tax amount for transaction 578. Be sure to appropriately reference the tr
Vlada [557]

Answer:

Explanation:

Formulas!D11: =C11*0.0675

4 / 7  (57.1%)

Feedback:

[-2] The formula in cell D11 does not reference the sales tax rate

[-1] The tax rate reference is not absolute

Copy the formula you used in cell D11 down to calculate the sales tax amount for the remaining transactions.

1 / 1  (100.0%)

Feedback:

Construct a formula in cell E11 to calculate the total amount for transaction 578. Be sure to appropriately reference the transaction amount in cell C11 and the sales tax amount in cell D11 so that you can reuse your formula to calculate the total for the remaining transactions.

Formulas!E11: =SUM(C11:D11)

6 / 6  (100.0%)

Feedback:

Copy the formula you used in cell E11 down to calculate the total for the remaining transactions.

2 / 2  (100.0%)

Feedback:

Use the SUM function to calculate the “Grand Total” in for all transactions in cell E24.

Formulas!E24: =SUM(E11:E23)

4 / 4  (100.0%)

7 0
3 years ago
Having a low credit score can make it more difficult to: Obtain a car loan Open a new credit card Secure an apartment lease All
-Dominant- [34]

Answer:

all of the above

Explanation:

3 0
3 years ago
Which stream of digital arts are content manager, content developer, flash developer, and information architect a part of?
Varvara68 [4.7K]
Its A. web design (plato)
5 0
4 years ago
Which statement is true about the elements of the interface of a presentation program? A. The status bar appears at the top of t
Ivan

Answer:

C. Rulers indicate the margins, tabs, and indents in a presentation slide.

Explanation:

6 0
4 years ago
Read 2 more answers
Other questions:
  • The small diagonal arrow in some command groups lower-right corner is a __________.
    10·1 answer
  • ____ devices are high-performance storage systems that are connected individually to a network to provide storage for the comput
    5·1 answer
  • Mark of athena ar answers
    6·1 answer
  • Select the three business advantages of globalization.
    10·1 answer
  • By default, Outlook displays messages in the Content pane grouped by the
    13·1 answer
  • Draw the final structure that will house the electronic system​
    15·1 answer
  • PLEASE HELP!
    12·1 answer
  • How to change the microsoft word pages to black background
    8·1 answer
  • 1 bulb controlled by 2-three way switches using 12 volts battery.<br><br> pahelp po
    10·1 answer
  • If I bought mine craft p.e. for 7.99 and hook my Micro soft account up, will i get java edition
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!