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
Smith, Smith, Smith, and Smith (S4) is a regional accounting firm will be moving to a new four-story building. There will two Lo
ICE Princess25 [194]

Answer:

Crosstalk, Jitter, Impulse noise.

Explanation:

Crosstalk is a network error that occurs when one pair of cable causes interference on another pair of cables thereby preventing efficient data transmission.

Jitter may also impair the accuracy of the data being transmitted across network because minute variations in amplitude, phase, and frequency always occur. The generation of a perfect carrier signal in an analog circuit is almost impossible. The signal may be affected by continuous and rapid network gains or phase changes.

Impulse noise (also referred to as spikes) is the primary source of errors in data communications.  Impulse noise can be caused by positioning a communications cable near a source of intermittent but strong electromagnetic pulses, such as an elevator motor.

Counter measures

Shielding (protecting wires by covering them with an insulating coating) is one of the best ways to prevent impulse noise, cross-talk.

Amplifiers can be used to increase signal strength since the connection would run across 4 floors.

5 0
4 years ago
(Financial application: compound value) Suppose you save $100 each month into savings account with an annual interest rate of 5%
Nostrana [21]

Solution:

initial = float(eval(input('Enter the monthly saving amount: ')))

x = (1 + 0.00417)

month_one = initial * x

month_two = (initial + month_one) * x  

month_three = (initial + month_two) * x  

month_four = (initial + month_three) * x

month_five = (initial + month_four) * x  

month_six = (initial + month_five) * x  

print('The sixth month value is: '+str(month_six))  

Don't forget the saving amount, and initialize the balance with that amount. Inside the loop, work out and add the interest and then add the saving amount for the next month.

balance = 801

for month in range(6):

  balance = balance * (1.00417)

print(balance)

7 0
3 years ago
Anyone from qls<br><br>or grax here<br><br>in bs​
PIT_PIT [208]

Answer:

No, I don't think I've ever heard of DLS or Grax either if I'm being honest.

May I have brainliest please? :)

7 0
3 years ago
When you are given a set of tables and asked to create a database to store their data, the first step is to ________?
Vlad1618 [11]
Scan   the tables  to make a digital copy of them
6 0
3 years ago
When molten igneous material intrudes into rock _____ metamorphism can occur.
Gnom [1K]
B) Contact metamorphism can occur.
8 0
3 years ago
Other questions:
  • Molly, a technician, has been tasked with researching an emulator for the software developers to test cross-platform application
    7·1 answer
  • You can access various sites on the WWW by using hyperlinks or by______. A. entering a key word for your search B. following dir
    12·2 answers
  • The command button to protect a document is part of the​.
    10·1 answer
  • Please Help!! How to code this in Python?
    11·1 answer
  • Explain how computer system is different from computer in 150 words
    14·1 answer
  • What type of undocumented yet benign hidden feature launches after a special set of commands, key combinations, or mouse clicks?
    15·1 answer
  • 4.11 lesson practice quizz need help on 2 and 3
    5·1 answer
  • You were just hired as an IT Specialist for Smalltown School District. Your first assignment is to review a problem area&amp; in
    11·1 answer
  • Identify 5 internal and external hardware components of a server
    5·1 answer
  • What can I do If my Texas Instrument TI-84 calculator is not giving accurate answers?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!