10.11 LAB: Pet information (derived classes) The base class Pet has private data members petName, and petAge. The derived class Dog extends the Pet class and includes a private data member for dogBreed. Complete main() to: create a generic pet and print information using PrintInfo(). create a Dog pet, use PrintInfo() to print information, and add a statement to print the dog's breed using the GetBreed() function.

Answers

Answer 1

Answer:

Answered below.

Explanation:

//Program in Java

Class Test{

public static void main (String[] args){

//create a pet object

Pet pet = new Pet();

//call pet object's printInfo method

pet.printInfo();

//create a new Dog object

Dog dog = new Dog();

//dog can access the printInfo method of the Pet class because it derives from it

dog.printInfo();

//dog can also call it's private method.

dog.getBreed();

}

}


Related Questions

Suppose a byte-addressable computer using set-associative cache has 2 16 bytes of main memory and a cache size of 32 blocks and each cache block contains 8 bytes. a) If this cache is 2-way set associative, what is the format of a memory address as seen by the cache; that is, what are the size of the tag, set, and offset fields

Answers

Answer:

Following are the responses to these question:

Explanation:

The cache size is 2n words whenever the address bit number is n then So, because cache size is 216 words, its number of address bits required for that  cache is 16 because the recollection is relational 2, there is 2 type for each set. Its cache has 32 blocks, so overall sets are as follows:

[tex]\text{Total Number of sets raluired}= \frac{\text{Number of blocks}}{Associativity}[/tex]

                                               [tex]=\frac{32}{2}\\\\ =16\\\\= 2^4 \ sets[/tex]

The set bits required also are 4. Therefore.

Every other block has 8 words, 23 words, so the field of the word requires 3 bits.

For both the tag field, the remaining portion bits are essential. The bytes in the tag field are calculated as follows:

Bits number in the field tag =Address Bits Total number-Set bits number number-Number of bits of words

=16-4-3

= 9 bit

The number of bits inside the individual fields is therefore as follows:

Tag field: 8 bits Tag field

Fieldset: 4 bits

Field Word:3 bits

Describe a problem you’ve solved or a problem you’d like to solve. It can be an intellectual challenge, a research query, an ethical dilemma — anything of personal importance, no matter the scale. Explain its significance to you and what steps you took or could be taken to identify a solution.

Answers

Answer:

Explanation:

I run an online e-commerce store and lately its been very difficult keeping track of customer detail, incoming orders, keyword generation etc. One solution that I thought about would be an application that controls all of that for me. In order to accomplish this I would first need to design and create a GUI that contains all of the necessary buttons and displays for the information. Then I would need to code a webscraper using Python to grab all of the data from e-commerce store as soon as it becomes available, organize it, and display it within the GUI.

Other Questions
Why was Rosa Parks a celebrated figure in the civil rights movement?She acquired justice for Emmett Till.She wrote legislation to end segregation in Alabama.She founded the NAACP and guided bus boycotts.She inspired people to defy segregation laws. hewlp pwealse me giwve brainllest plllllllllllllllllls Freshwater makes up about 90% of the Earth's surface. What is it called when milk is heated to destroy bacteria For every 1 litre of water used to make a medicine, 300 ml of sucrose and 750ml of saline solution are used. Express the amount of water, sucrose and saline solution needed as a ratio in its simplest form. The Corbit Corp. sold merchandise for $10,000 cash. The cost of the goods sold was $7,590. The journal entries to record this transaction under the perpetual inventory system would bea.Cash10,000 Sales10,000Cost of Goods Sold7,590 Inventory7,590b.Cash7,590 Sales7,590Cost of Goods Sold7,590 Inventory7,590c.Cash10,000 Sales10,000Cost of Goods Sold10,000 Inventory10,000d.Cash10,000 Inventory10,000Cost of Goods Sold7,590 Sales7,590 Which part of homeostasis is this adorable puppy balancing out with his little stuffed animal buddy?Body TemperatureEnergyWasteWater LevelCutenessPlzzz help Please help with one history question!!!! During an economic downturn, 11 companies were sampled and asked whether they were planning to increase their workforce. Only 2 of the 11 companies were planning to increase their workforce. Use the small-sample method to construct an 80% confidence interval for the proportion of companies that are planning to increase their workforce. Round the answers to at least three decimal places.An 80% confidence interval for the proportion of companies that are planning to increase their workforce is _______ < p< ________ Which of these features could apply to the word "Love"? a. [+ MALE]b. [ ANIMATE]c. [+ ABSTRACT]d. [ COMMON]e. All of the above explain the use of NBT In AABC, what is AB to the nearest tenth? I NEED SOME HELP...What are ions14 points if you answer this Question 5 (13 points)Which of the following items are found in a poem?Question 5 options:linesparagraphsmeterstanzascharacterssentencesrhyme (PLEASE HELP CORRECT ANSWER GETS BRAINLIEST ALSO 30 POINTS) Read the sentence. San Francisco's Golden Gate Bridge, along with its ship docks and intermediate bridges, weighed 894,500 tons when it opened.Which topic best describes the sentence?the Golden Gate Bridge's weight capacity for carsthe weight of the Golden Gate Bridge when it openedthe intermediate bridges in the San Francisco Baythe steps to measure docks and intermediate bridges Find the area of the trapezoid. Round your answer to the nearest hundredth. Find the area for this problem The table shows the proportional relationship between the number of computersa company sold, x, and the profit that the company made, y. The profit, y, can bewritten in terms of x, the number of computers sold: y = What expressioncompletes the equation?Profit on SalesNumber of Computers SoldProfit (dollars)345071050111650152250 Explain how to use the standard normal table to find the probability associated with the shaded area under the curve Plzz I asked this three times! The Functions r and s are defined as follows.r(x)=-2x+2s(x)=x^2+2Find the value of s(r(2)).