Question

In: Computer Science

Please type the answer for i can copy it. Thank you very much. -Question 1 Respond...

Please type the answer for i can copy it. Thank you very much.

-Question 1

Respond to the following in a minimum of 175 words:

Read the following pseudocode class definitions:

Class Plant

Public Module message()

Display "I'm a plant."

End Module

End Class

Class Tree Extends Plant

Public Module message()

Display "I'm a tree."

End Module

End Class

-Question 2

Given these class definitions, determine what the following pseudocode will display:

Declare Plant p

Set p = New Tree()

Call p.message()

-Question 3

Discuss how algorithms address object-oriented classes and objects.

Solutions

Expert Solution

// Definition of the class Plant
class Plant
{
   // public method message
   public:
       void message()
       {
           cout << "I'm a plant." << endl;
       }
};

// Class tree inherit from plant class  
class Tree : Plant
{
   // public method message
   void message()
   {
       cout << "I'm a tree.";
   }
};

// main function
int main()
{
   // created a plant class object
   Plant p;
   // assign plant p reference of tree object.
   // Derived object assigned to base class
   p = new Tree();
   p.message(); // called message function but plant will be called.
}

Answer3:
Object oriented programming is writing the code for the real time
object. For eg you can write the code to demonstrate the operation
of a fan so the code you are writing is actually the algorithm to operate the fan.
With help of object oriented programming you can you can write the
algorithm for the real time object eg: robots or blood pressure
measuring device.


Related Solutions

Please type answer for i can copy it. Thank you very much. -Question Respond to the...
Please type answer for i can copy it. Thank you very much. -Question Respond to the following in a minimum of 175 words: Discuss the following:   Differences, advantages, and disadvantages of Java® compared to another language of your choice (e.g., C++, Python, Ruby) Database connectivity and file handling in Java® and in your other chosen language  
Please type answer for i can copy it. Thank you very much. -Question 1 What is...
Please type answer for i can copy it. Thank you very much. -Question 1 What is a polymorphism ? -Question 2 Can you start an algorithm in pseudo code? language is in (OOP) object oriented programming
Please type out answer for i can copy it. Need at least 175 words. Thank you...
Please type out answer for i can copy it. Need at least 175 words. Thank you very much. -Question Why are data manipulation, efficiency, and memory useful in programming? Provide specific examples for each.
CAN YOU PLEASE ANSWER ALL QUESTION AND PLEASE ANSWER AS SOON AS POSSIBLE THANK YOU 1....
CAN YOU PLEASE ANSWER ALL QUESTION AND PLEASE ANSWER AS SOON AS POSSIBLE THANK YOU 1. Behavioral activity is prone to a lot of variation; would Open field and Inhibitory Avoidance be valuable Primary and only endpoint measures? Explain why? 2. Lesions of the amygdala made after a delay from training result in partial retention of fear motivated Inhibitory avoidance task. On the other hand, pharmacological manipulations of the amygdala immediately after training abolished the strength of inhibitory avoidance learning....
HI please answer all parts of my question. Thank you so much! I will rate you!...
HI please answer all parts of my question. Thank you so much! I will rate you! Why do we call cardiac muscle to be a syncytium of many individual muscle cells? What is the name of membranes that connect longitudinally adjacent muscle cells? As you know the mechanism of organophosphates involves irreversible inhibitors of AChE. Organophosphates have been used in several murders (VX used to kill the half-brother of North Korean dictator Kim Jong Un; Sarin gas used to kill...
Please answer a statistic problem(please answer all subquestions). Thank you very much. NCbirths, cont' d. This...
Please answer a statistic problem(please answer all subquestions). Thank you very much. NCbirths, cont' d. This time we will use a subset of the dataset after removing premature birth (36 weeks or sooner) and continue to use MomRace as the explanatory variable to predict birth weight. To get NCbirths: install.packages("Stat2Data") library(Stat2Data) data("NCbirths") (a) Use the following R command to remove premature birth and create a dataset noPremie. noPremies<-subset(NCbirths, NCbirths$Premie==0) ##subset(dataName, condition) (b) Construct a side-by-side boxplot of birth weights separated...
PLEASE ANSWER ALL 4 THANK YOU VERY MUCH!!!! 1. How was the Periodic Table originally organized?...
PLEASE ANSWER ALL 4 THANK YOU VERY MUCH!!!! 1. How was the Periodic Table originally organized? Explain the current organization of the Periodic Table and why it is a more accurate layout of the elements. 2. What is the difference between groups and periods? What are the common names for groups IA, IIA, VIIA, VIIIA? 3. Why were elements in group 18, VIIIA, formerly known as inert gases? How is the current name of “noble gases” more appropriate? Provide examples...
Please answer each question and show calculation/ provide explanations. Thank you so much. Question 1 You...
Please answer each question and show calculation/ provide explanations. Thank you so much. Question 1 You have just been hired as the staff accountant for Maximum Corporation. However, the accounting manager is unclear about your ability to determine where certain increases and decreases should be placed. Indicate in the columns below by placing a check-mark (√        ) in the appropriate column identified. Office rent is increased.                                   Service Revenue is increased. Prepaid Expense is reduced. Cash is decreased. Plant and machinery...
Can you please type, I will rate you well! Thank you! In this activity, you will...
Can you please type, I will rate you well! Thank you! In this activity, you will be devising a Data Collection plan that describes how information on each asset will be collected. Develop a Data Collection plan that can be used to perform Data Collection on the different assets in the Action Forensics organization. As you develop this plan you will have to make decisions based on your understanding of how the company works. Do not worry that you are...
Please type out answer, thank you. Question 1 On October 1, 2018, the Marshall Company sold...
Please type out answer, thank you. Question 1 On October 1, 2018, the Marshall Company sold a large piece of machinery to the Hammond Construction Company for $80,000. The cost of the machine was $40,000. Hammond made a down payment of $10,000 and agreed to pay the remaining balance in seven equal monthly installments of $10,000, plus interest at 12% on the unpaid balance, beginning November 1. Required: Identify three alternative methods for recognizing revenue and costs for the situation...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT