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
olasank [31]
3 years ago
11

Consider the following class definitions. public class BClass { private int x; public void set(int a) { x = a; } public void pri

nt(){ } } public class DClass extends BClass { private int y; public void set(int a, int b) { //Postcondition: x = a; y = b; } public void print(){ } } Which of the following is the correct definition of the method set of the class DClass? (i) public void set(int a, int b) { super.set(a); y = b; } (ii) public void set(int a, int b) { x = a; y = b; }
Computers and Technology
1 answer:
Stella [2.4K]3 years ago
7 0

Answer:

The answer to the given question is the option "(i)".

Explanation:

In this question, the correct option is the "(i)" because In this method definition we use the super keyword. It refers to the parent's class. In this method, we use the superclass to call the above (parent) class method. and if we choose the option (ii), It will not call the parent class. That's why we use the option (i) which is correct.

You might be interested in
The 6 steps for PowerPoint competency from the TED talk in the module "How to Avoid Death by PowerPoint."?
KIM [24]

Answer:

1. Do some presentation preparation work

2. Set the right tone and end on a high note.

3. Create sleek and stylish slides.

4. Get your audience to focus.

5. Its all about you.

Explanation:

1. Do some presentation preparation work:

A good presentation begins, not with slides, but with a pencil and paper. Research your audience’s background, interests and capabilities. What do they already know, for instance, and what can they learn from you?

2. Set the right tone and end on a high note:

You have no more than 30 seconds to secure your audience’s attention. So, what attention-grabbing opener will you use?

Visual communications expert Curtis Newbold suggests “a fascinating quote; an alarming or surprising statistic; asking your audience a question; telling a relevant and funny joke… an imaginary scenario; or a demonstration''.

3. Create sleek and stylish slides:

Once you have your story down, you can start to design your slides.  

Before you do, it’s important to think about the practicalities. Will they, for instance, be displayed Widescreen with a 16:9 ratio? Or Standard with 4:3? This might seem like a small detail, but it can make a huge difference in terms of visual impact.

4.  Get your audience to focus:

The most important thing is to grab your audience’s attention straight away – and then maintain it! You want your audience to go away having learned something. So, make it as easy as possible for people to grasp your message “from the off”!

5.  Its all about you:

Finally, remember that, ultimately, it’s you that the audience should be paying attention to, not your slides!

PowerPoint can be used to create great visual aids, but the success of your presentation is determined by the way you deliver them. So, tell your story with a confident, compelling physical presence, and master it by rehearsing it 10 to 15 times.

6 0
3 years ago
Write a function with this prototype:
sp2606 [1]

Answer:

Following are the code to this question:

#include <iostream> //defining header file  

using namespace std;

void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration

void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number

{

string s; //defining string variable

if(levels == 0) //defining condition statement that check levels value is equal to 0

{

outs << prefix << endl;  //use value

}

else //define else part

{

for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method

{

s = prefix + c + '.'; // holding value in s variable  

numbers(outs, s, levels-1); //call method numbers

}

}

}

int main() //defining main method

{

numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value

return 0;

}

Output:

please find the attachment.

Explanation:

Program description:

  • In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value.
  • Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method.
  • In the main method we call the number method and pass the value in its parameter.  

5 0
3 years ago
Which of the following are examples of IT
Advocard [28]

Answer:

Computer hardware engineer

Systems analyst

Database administrator

7 0
3 years ago
Programa que previene, detecta y elimina virus informáticos.
vesna_86 [32]

Answer:

Software antivirus

Explanation:

6 0
2 years ago
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
cupoosta [38]

Answer:

Following are the program in java language:

import java.util.*; // import package

public class Main

{

public static void main(String[] args) // main method

{

 int num; // integer variable declaration

 double r; //double varaible declaration

 char ch; // char variable declaration

Scanner scnr=new Scanner(System.in); // creating the instance of scanner

 System.out.println("Enter the string:");

 String str=scnr.nextLine(); // reda string by user

System.out.println("Enter the integer value:");

 num=scnr.nextInt(); // Read integer value by the user

 System.out.println("Enter the Double value:");

 r=scnr.nextDouble(); // read double value by user

 System.out.println("Enter the character value:");

 ch= scnr.next().charAt(0); // read character by user

 System.out.print(num + " ,"); // display them in a single line

 System.out.print( " " +r +" ,");//dislpay in a single line  

  System.out.print( " " +ch +",");//dislpay in a single line

 System.out.print(" " +str);//dislpay in a single line

}

}

Output:

Enter the string:

ram

Enter the integer value:

34

Enter the Double value:

45.789

Enter the character value:

r

34 , 45.789 , r, ram

Explanation:

Following are the description of program

  • Read the integer ,string,char,double value by the user by using scanner class in "num","str","ch" and "r" variable respectively
  • Print that value in a single line separated by comma by System.out.println statement.

7 0
3 years ago
Other questions:
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • Your new home has a vacuum system. what kind of computer is controlling it?
    5·1 answer
  • Which of the following software programs provides for e-mail communication?. A. Access. B. Word Perfect. C. Outlook. D. Excel
    15·2 answers
  • What is the purpose of ergonomics in the workplace? A.Keep workers safe and injury free
    5·2 answers
  • Written and artistic expressions are protected by
    8·1 answer
  • What is a major way that a consumer can protect himself/herself when getting a credit card? A) Making sure that they get a very
    8·1 answer
  • Which of the following is a hand-drawn animation that takes a large amount of time to complete?
    5·1 answer
  • Which key combination should you use
    9·2 answers
  • What option would fit the most content on a page?
    10·1 answer
  • A license may limit the use of a software application to a specific device. Group of answer choices True False
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!