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
zhenek [66]
2 years ago
11

A compile-time error occurs because obj1 is declared as type C1 but instantiated as type C2. A compile-time error occurs because

obj1 is declared as type C1 but instantiated as type C2. A A runtime error occurs because method m1 does not appear in C2. A runtime error occurs because method m1 does not appear in C2. B Method m1 is not executed because it does not appear in C2. Method m1 is not executed because it does not appear in C2. C Method m2 is executed from the subclass instead of the superclass because obj1 is instantiated as a C2 object. Method m2 is executed from the subclass instead of the superclass because obj1 is instantiated as a C2 object. D Method m2 is executed twice (once in the subclass and once in the superclass) because it appears in both classes
Computers and Technology
1 answer:
Agata [3.3K]2 years ago
6 0

The code segment doesn't produce the intended output (AB) because "method m1" was not executed since it does not appear in C2.

<h3>What is a method?</h3>

In computer programming, a method can be defined as sets of instruction or a block of executable codes that are used to break down a complex problem into small but manageable fragments.

Thus, methods are typically used by programmers to break down a complex problem into simple, small and manageable fragments. In this scenario, the code segment doesn't produce the intended output (AB) because "method m1" was not executed since it does not appear in C2.

Read more on methods here: brainly.com/question/25619349

You might be interested in
Where do you click to add keywords to describe your image?
Brut [27]

Answer:

D. I use a Mac and I right-click the file, then add tags. I can create new tags for describing a png image (or pdf if it was exported).

6 0
3 years ago
Find the error in the following pseudocode. Module main () Call raiseToPower (2, 1.5) End Module Module raiseToPower (Real value
Nataliya [291]

Answer:

Call raiseToPower (2, 1.5) '

or

raiseToPower (Real value, Integer power)

Explanation:

To solve this, first organize the pseudo code,

1) main ()

2) Call raiseToPower (2, 1.5)

3) End Module

4) Module

5) raiseToPower (Real value, Integer power)

6) Declare Real result

7) Set result=value^power

8) Display result

9) End Module

The first three lines in pseudo code are representing the main module. While lines 4-9 shows the definition of module that is being called in main function.  

If we look at the raiseToPower definition at line5, we can see that it is requiring any real value for the base number. However, for power, it defines only integers.

But, in the main function, 1.5 is placed as a power that is not an integer. Therefore, this is the error in pseudo code. It should be changed to any integer.

Alternatively, change the integer power to real power to avoid this error.

8 0
3 years ago
Write a full class definition for a class named Player , and containing the following members:
Paraphin [41]

Answer:

I used C++ to implement this program using dev c++, however, i defined the public method inside the class. The code with illustration of this question is given in section phase. If you want to define the classes outside from class then you can use scope resolution operator to access the method of the class. However, the complete running code is given below in <em>explanation </em>section

Explanation:

#include <iostream>// included preprocessor directive

using namespace std;

class player// class player is started from here

{

private:// class varaibles are set at here and scope of varialbe is private.

 string name;//variable for getting and setting name of player

 int score;//variable for getting and setting score of player

 

public:// declaring public method that can be accessbile outside of class but in this program

 void setName (string name)// public method for setting name of player

{

 this->name=name;// name is initialized by paramenter name to variable name

}

 void setScore(int score)//publice method for setting score of player

{

 this->score=score;

}

int getScore()// public method for getting score of player

{

 return score;// on call, return the score of player

}

string getName()// public method for getting name of player

{

 return name;// return player name;

}

 

};//end of class "player"

int main()//main function get executed

{

   player firstPlayer;//class object "firstPlayer" is created

firstPlayer.setName("Renaldo");// firstPlayer name is initialized

firstPlayer.setScore(500);// assgined score to firstPlayer

string getname=firstPlayer.getName();// get name of firstPlayer

int getscore=firstPlayer.getScore();//get score of firstPlayer

cout<<getname;//print name of firstPlayer

cout<<"\n";//line break

cout<<getscore;//print score of firstPlayer

cout<<"\n";//line break

   

   return 0;//end of program

}

6 0
3 years ago
How to download music to your mp3 player off computer
skelet666 [1.2K]
For free or for money cuz for free u would do ot on ur mp3 and money i would yse apple music
3 0
3 years ago
Explain the steps in starting the MS Access from the Start Menu.​
blondinia [14]

Explanation:

<em>As</em><em> </em><em>with</em><em> </em><em>most</em><em> </em><em>windows</em><em> </em><em>programs</em><em> </em><em>Access</em><em> </em><em>can</em><em> </em><em>be</em><em> </em><em>executed</em><em> </em><em>by</em><em> </em><em>navigation</em><em> </em><em>the</em><em> </em><em>start</em><em> </em><em>menu</em><em> </em><em>in</em><em> </em><em>the</em><em> </em><em>lower</em><em> </em><em>left</em><em> </em><em>hand</em><em> </em><em>corner</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>windows</em><em> </em><em>desktop</em><em>. </em><em>To</em><em> </em><em> </em><em>Acess</em><em>,</em><em> </em><em>click</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>start</em><em> </em><em>button</em><em>,</em><em> </em><em>then</em><em> </em><em>the</em><em> </em><em>programs</em><em> </em><em>menu</em><em> </em><em>then</em><em> </em><em>move</em><em> </em><em>to</em><em> </em><em>the</em><em> </em><em>Microsoft</em><em> </em><em>Office</em><em> </em><em>m</em><em>enu</em><em> </em><em>a.d</em><em> </em><em>finally</em><em> </em><em>click</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>Microsoft</em><em> </em><em>Access</em><em> </em><em>menu</em><em> </em><em>item</em><em>. </em>

6 0
3 years ago
Other questions:
  • Which of the following would an interactive media proffessional must likely need
    9·1 answer
  • Which part of an I-statement involves a description of your needs or feelings?
    12·1 answer
  • Which feature of a browser will you select to block pop-ups? view help tools file
    15·2 answers
  • The human resource (HR) manager stores a spreadsheet with sensitive personal information on her local workstation. The spreadshe
    11·1 answer
  • Explain how inflation flattens the universe
    6·2 answers
  • Which one of the following provides an authentication mechanism that would be appropriate for pairing with a password to achieve
    13·1 answer
  • In apersuasive message, opposing ideas should be:
    13·1 answer
  • Chegg A full bootstrap program Select one: a. may be infected by viruses. b. is stored in ROM to ensure to avoid any infection f
    13·1 answer
  • You are the IT security administrator for a small corporate network. You would like to use Group Policy to enforce settings for
    14·1 answer
  • Why is biodiversity so important to ecosystems?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!