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
juin [17]
3 years ago
7

Consider the following base and derived class declarations: class BaseClass { public: void BaseAlpha(); private: void BaseBeta()

; float baseField; }; class DerivedClass : public BaseClass { public: void DerivedAlpha(); void DerivedBeta(); private: int derivedField; }; For each class, do the following:
a) List all private data members.
b) List all private data members that the class's member functions can reference directly.
c) List all functions that the class's member functions can invoke.
d) List all member functions that a client of the class may invoke.
Computers and Technology
1 answer:
Alina [70]3 years ago
8 0

Answer:

a) Baseclass - baseField

DerivedClass - derivedField

b) BaseClass - baseField

DerivedClass - derivedField

c) BaseClass - BaseBeta(), BaseAlpha()

DerivedClass - BaseAlpha(), DerivedAlpha(), DerivedBeta()

d) BaseClass - BaseAlpha()

DerivedClass - BaseAlpha(), DerivedAlpha(), DerivedBeta()

Explanation:

a) Since, private members of a class cannot be inherited, that is why, DerivedClass has only one private data member.

b) Member function of a class can invoke private data variables of the class, so, they can refer to their private members on their own but DerivedClass has no access to BaseClass's private members.  

c) Every member function of a class can invoke every other member function of that class, but DerivedClass's member function cannot invoke BaseClass's private member functions.

d) Object of a class has no access to private members of a class, that is why they can invoke only public member functions of the class.

You might be interested in
Zadanie nr 1
Gennadij [26K]

Answer:

Explanation:

Rezonans, Obiekt bez wibracji ma tendencję do robienia tego z określoną częstotliwością zwaną naturalną lub rezonansową częstotliwością obiektu. (Ta częstotliwość zależy od wielkości, kształtu i składu przedmiotu). Taki przedmiot będzie silnie wibrował, gdy zostanie poddany wibracjom lub regularnym impulsom o częstotliwości równej lub bardzo zbliżonej do swojej częstotliwości naturalnej. Zjawisko to nazywa się rezonansem. Dzięki rezonansowi stosunkowo słaba wibracja w jednym obiekcie może powodować silne wibracje w innym. Analogicznie termin rezonans jest również używany do opisania zjawiska, w którym oscylujący prąd elektryczny jest wzmacniany sygnałem elektrycznym o określonej częstotliwości.

Przykład rezonansu zapewnia silnik, który powoduje wibracje mebla w innej części tego samego domu. Drgania te występują, ponieważ częstotliwość naturalna mebli jest równa częstotliwości drgań ustawianych przez silnik. Mówi się, że meble rezonują z silnikiem. Rezonans można również zaobserwować w samochodzie, gdy pewna popielniczka Partan, na przykład wibruje, gdy samochód jedzie z określoną prędkością. Popielniczka rezonuje z wibracjami silnika przy tej prędkości.

Rezonans mechaniczny może wytwarzać wibracje wystarczająco silne, aby zniszczyć obiekt, w którym występują. Na przykład żołnierze maszerujący nad mostem mogą wytwarzać ekstremalne wibracje z częstotliwością naturalną mostu i roztrzaskiwać go na części. Z tego powodu żołnierze przebijają się, by przejść przez most. W 1940 r. Podmuchy wiatru w Puget Sound Narrows w Tacoma w stanie Waszyngton spowodowały, że most wiszący wibruje z naturalną częstotliwością i most zawalił się.

W muzyce rezonans służy do zwiększenia intensywności (głośności) dźwięku. Na przykład stosunkowo słabe wibracje wytwarzane na końcu rurki organowej powodują, że kolumna powietrza w rurze wibruje w rezonansie, znacznie zwiększając głośność dźwięku. Zasada ta dotyczy także głosu ludzkiego, w którym wibracje strun głosowych są wzmacniane przez wibracje rezonansowe w kanałach ustnych i nosowych.

Rezonans elektryczny służy do strojenia radiotelefonów i telewizorów. Strojenie polega na ustanowieniu obwodu o częstotliwości rezonansowej równej przydzielonej częstotliwości żądanej stacji.

6 0
3 years ago
A student is reading a book for language arts. She has to finish three chapters by class tomorrow, because there will be a quiz.
Jobisdone [24]

Answer:

Distracted..?

8 0
3 years ago
Read 2 more answers
Why is the statement if x=y not working in python
Veronika [31]

Answer:

x=1

Explanation:

Re-run your installer (e.g. in Downloads, python-3.8. 4.exe) and Select "Modify". Check all the optional features you want (likely no changes), then click [Next]. Check [x] "Add Python to environment variables", and [Install]

8 0
2 years ago
Which kind of image is indispensable and needs added text to go with it?
STatiana [176]

Answer:

A chart and a graph

Explanation:

8 0
3 years ago
What are the events?
erastovalidia [21]

Answer:

a thing that happens or takes place, especially one of importance.

8 0
3 years ago
Other questions:
  • Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
    13·2 answers
  • WordArt styles allow you to add ____.
    9·1 answer
  • How can my computer catch a virus?
    13·1 answer
  • Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
    14·1 answer
  • You are part of a testing team at a software business. Your job is to see how many concurrent users the system can host and how
    7·1 answer
  • What is the meaning of website cookies? brief explanation ​
    9·2 answers
  • The algorithm ____ is used to find the elements in one range of elements that do not appear in another range of elements.
    5·1 answer
  • When you buy software, you then own it and can do anything you’d like with it, including giving it to friends to install on thei
    12·1 answer
  • Which of the following is not a selection tool in Adobe photoshop
    15·2 answers
  • When you open your word-processing program, it opens in a<br> field<br> menu
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!