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
jeka57 [31]
3 years ago
5

Among object-oriented languages, one feature that varies considerably is whether the language allows multiple inheritance. C++ d

oes but Ada does not. Java takes a middle ground approach of allowing multiple inheritance of interfaces but not classes. Using a C++ example, illustrate some of the complexities that multiple inheritance introduces. How does C++ deal with them? Why does Java's middle ground approach offer some of the benefits of multiple inheritance while avoids its problems.
Computers and Technology
1 answer:
Amiraneli [1.4K]3 years ago
4 0

Multiple inheritance causes Diamond problem which happens when:

Class A is parent of class B and C

Now when class D will be inherited from both Class B and C it will have all the members of class A and B which if same will confuse the compiler to import which one?

C++ solves it by using virtual keyword with them and thus telling the compiler which one to inherit.

Java has introduced the interface concept rather then allowing multiple inheritance.

You might be interested in
When was microsoft word for windows invented?
Dahasolnce [82]
1981 fue inventado por Bill gates y paul allen
4 0
3 years ago
Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string.
ICE Princess25 [194]

Answer:

Follows are the modified code in c++ language:

#include<iostream>//header file

#include<string>//header file

using namespace std;

int main()//main method

{

string name,address, MSG_YES, MSG_NO;//defining string variable

int item,quantity,size=6, i=0;//defining integer variable

double price;//defining double variable  

int VALID_ITEM[]={106,108,307,405,457,688};//defining integer array and assign value

double VALID_ITEM_PRICE[]={0.59,0.99,4.50,15.99,17.50,39.00};//defining double array and assign value

bool foundIt=false;//defining bool variable  

MSG_YES="Item available";//use string variable to assign value

MSG_NO = "Item not found"; //use string variable to assign value

cout<<"Input name: ";//print message

cin>>name;//input value in string variable

cout<<"Input Address: ";//print message

cin>>address;//input value in string variable

cout<<"Input Item: "<<endl;//print message

cin>>item;//input value in string variable

cout<<"Input Quantity: "<<endl;//print message

cin>>quantity;//input value in string variable

while(i <size)//defining while that checks i less then size  

{

if (item ==VALID_ITEM[i]) //use if block to match item in double array

{

foundIt = true;//change bool variable value

price = VALID_ITEM_PRICE[i];//hold item price value in price variable  

}

i++;//increment the value of i

}

if (foundIt == true)//use if to check bool variable value equal to true

{

cout<<MSG_YES<<endl;//print value

cout<<"Quantity "<<quantity<<" at "<<"Price "<<price<<"each"<<endl;//print value

cout<<"Total"<<quantity*price;//calculate the total value

}

else//else block

cout<<MSG_NO;//print message  

}

Output:

please find the attached file.

Explanation:

In the above given C++ language modified code, four-string variable " name, address, MSG_YES, and MSG_NO", four integer variable "item, quantity, size, and i", and "integer and double" array is defined, that holds values.

In the string and integer variable "name, address, and item, quantity", we input value from the user-end and use the while loop, which uses the if block to check the "item and quantity" value from the user end and print its respective value.

6 0
3 years ago
Plz hurry !!!
lakkis [162]

Answer: The <u>Ordering Tag List </u>defines the numbering styles of lists in HTML pages.

<ol>

</ol>

Inside this tag, you have <li></li> which will contain individual lists.

For example:

<ol>

   <li> This is my first point. </li>

   <li> This is my second point. </li>

   <li> This is my second point. </li>

</ol>

is displayed as:

1. This is my first point. 

2. This is my second point. 

3. This is my second point.

Read more on Brainly.com - brainly.com/question/9724249#readmore

Explanation:

8 0
3 years ago
Read 2 more answers
Why do we have to watch a video to get answers?
IRINA_888 [86]

Answer:

The videos contain the answers.

Explanation:

4 0
2 years ago
Read 2 more answers
5g Speed vs 4g Speed. What's the Difference?
Zigmanuir [339]

Answer: 5G up to 100 times faster than 4G. With 5G reaching 10 gigabits per second – up to 100 times faster than 4G – 5G networks can deliver the level of performance needed for an increasingly connected society.Aug 10, 2020

4 0
3 years ago
Other questions:
  • Some smartphones use ______ text, where you press one key on the keyboard or keypad for each letter in a word, and software on t
    13·1 answer
  • Can someone fix this so that it only says "its a payday" on 15 and 30 and on all other days "sorry, it's not payday"
    9·1 answer
  • Identify the correct software or hardware applications in the passage below
    10·1 answer
  • What is the process of comparing data with a set of rules or values to find out if the data is correct?
    8·2 answers
  • Which type of cables are used for high-capacity trunk lines that provide main routes for telephone, cable, and internet communic
    15·1 answer
  • Which of the following is not a command for determining if MySQL is running on Linux (Ubuntu)?
    7·1 answer
  • Ill give 100 points to whoever gives me the CORRECT answer. I keep getting syntax errors when I do the "add:" part. Can someone
    10·2 answers
  • Reflection about information technology​
    11·1 answer
  • What type of malware is best known for carrying other malware as a payload?
    8·1 answer
  • Select the function of keypunches that were used as one of the earliest input devices. A. It was used to control the cursor on t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!