Write a program to implement the pseudocode given below for the procedural Fish example: Sub feed...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program to implement the pseudocode given below for the procedural Fish example: Sub feed (Byref state, Byref size) sizesize + 1 Output "Fish fed" If size = 5 Then "FISH" state End If End Sub thisFishState thisFishSize 1 Output this FishState, is of size While thisFishState <> "FISH" feed (this FishState, this FishSize) Endwhile "1 Output "It is now a big , this FishState Public Task 2 Write program statements to declare the class Animal, as shown in the pseudocode: Animal Classi Private Constructor (s, n) Procedure feed () Function getState () Function getSize () state: String size: Integer "Fish" Animal. Constructor (s, n) s Animal.state Animal. size End Constructor Animal.size Procedure Animal.feed () End If End Procedure n If Animal.size = 5 Then Animal.state "FISH" End Function. Animal.size + 1 Function Animal.getState () Return Animal.state End Function Function Animal.getSize() Return Animal.size I thisFishSize ("I SC 51 t ti ti ti Write a program to implement the pseudocode given below for the procedural Fish example: Sub feed (Byref state, Byref size) sizesize + 1 Output "Fish fed" If size = 5 Then "FISH" state End If End Sub thisFishState thisFishSize 1 Output this FishState, is of size While thisFishState <> "FISH" feed (this FishState, this FishSize) Endwhile "1 Output "It is now a big , this FishState Public Task 2 Write program statements to declare the class Animal, as shown in the pseudocode: Animal Classi Private Constructor (s, n) Procedure feed () Function getState () Function getSize () state: String size: Integer "Fish" Animal. Constructor (s, n) s Animal.state Animal. size End Constructor Animal.size Procedure Animal.feed () End If End Procedure n If Animal.size = 5 Then Animal.state "FISH" End Function. Animal.size + 1 Function Animal.getState () Return Animal.state End Function Function Animal.getSize() Return Animal.size I thisFishSize ("I SC 51 t ti ti ti
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
STI Task Performance Report Card Objective: At the end of the exercise, the students should be able to: Use arithmetic operators and aggregate functions Procedure: IT1924 1. Create a table named...
-
Ria works at a Quickie Carwash. That morning she was reluctant to go into work because her young son had complained of feeling hot and dizzy and she was concerned that he might be getting sick, but...
-
1) Draft a career mission statement for yourself. 2)Identify a suitable vacancy for yourself (in relation to the mission statement) and provide a screenshot of it if possible.
-
This bar chart displays the demographics (age group and gender) of a Business Analysis class Business Analysts Students 23-33 3410 M lem How many male students are in the class? 65 80 130 50
-
What approaches have been suggested to overcome the seasonality problem related to interim reporting?
-
Ismail Construction enters into a contract to design and build a hospital. Ismail is responsible for the overall management of the project and identifies various goods and services to be provided,...
-
In Figure 10.10, the ball's instantaneous velocity \(\vec{v}\) does not point in the same direction as the displacement \(\Delta \vec{r}\) (it points above the final position of the ball). Why?...
-
Fisk Corporation is trying to improve its inventory control system and has installed an online computer at its retail stores. Fisk anticipates sales of 49,000 units per year, an ordering cost of $8...
-
a) Risk analysis is the study of the underlying uncertainty of a given course of action and refers to the uncertainty of forecasted cash flow streams, the variance of portfolio or stock returns, the...
-
Determine the zero-force members in the Pratt roof truss. Explain your answers using appropriate joint free-body diagrams. A B 300 N C 400 N D L K J E F I H 12 m, 6 @ 2 m- 3 m
-
reversible heating and work: Tds = we have from the 1st and 2nd Laws of Thermodynamics for de + pd (1) = dh - 1 dp, where h = + For a calorically perfect gas we also have: = CT, h = CpT, p = pRT, R =...
-
Discuss whether risk mitigation strategies can always keep a companys operating costs to a minimum.
-
Identify the components of a demand forecast and some basic approaches to forecasting.
-
The ________ is a good measure of forecast error when the underlying forecast has significant seasonality and demand varies considerably from one period to the next. MAD MSE MKE MAPE
-
What Excel function/feature should be used to calculate a moving average? Solver =AVERAGE =MAVE Goal seek
-
________ forecasting methods use historical demand to make a forecast. Qualitative Time-series Causal Simulation
-
If the world terms of trade equal those of country F, then A.country H but not country F will gain from trade. B.country H and country F will both gain from trade. C.neither country H nor F will gain...
-
You are thinking of investing in one of two companies. In one annual report, the auditors opinion states that the financial statements were prepared in accordance with generally accepted accounting...
-
Calculate the amount of the child and dependent care credit allowed for 2012 in each of the following cases, assuming the taxpayers had no income other than the stated amounts. a. William and Carla...
-
Phil and Linda are 25-year-old newlyweds and file a joint tax return. Linda is covered by a retirement plan at work, but Phil is not. a. Assuming Phil's wages were $27,000 and Linda's wages were...
-
Abigail (Abby) Boxer is a single mother working as a civilian accountant for the U.S. Army. Her Social Security number is 676-73-3311 and she lives at 3456 Alamo Way, San Antonio, TX 78249. Helen,...
-
When you think of political persuasion, you may think of the effortsthat political campaigns undertake to persuade you that their candidate is betterthan the other candidate. In truth, campaigns are...
-
Approximately 50,000 new titles, including new editions, are published each year in the United States, giving rise to a $25 billion industry in 2001. In terms of percentage of sales, this industry...
-
Exeter, Inc., is a catalog firm that sells products in a number of different catalogs that it owns. The catalogs number in the dozens but fall into nine basic categories: 1. Clothing 2. Housewares 3....
Study smarter with the SolutionInn App