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
zhuklara [117]
3 years ago
5

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

nt() { System.out.print(x); } } 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 correctly redefines the method print of DClass?
(i) public void print() { System.out.print(x + " " + y); }
(ii) public void print() { super.print(); System.out.print(" " + y); }
Computers and Technology
1 answer:
Feliz [49]3 years ago
4 0

Answer:

Option (ii) is the correct option to the following code.

Explanation:

In the following code of the Java Programming Language, there is two print function after the set function then, we firstly set the value of x and print it through print function which is already declared then, we set the value of y through set function then, print the value of y through print function. So, that's why the following option is correct.

You might be interested in
Accessibility is the degree to which a product or service is readily available and usable by _____.
spayn [35]

Answer:

Accessibility in the sense considered here refers to the design of products, devices, services, vehicles, or environments so as to be usable by people with disabilities. The concept of accessible design and practice of accessible development ensures both "direct access" (i.e. unassisted) and "indirect access" meaning compatibility with a person's assistive technology (for example, computer screen readers).

Accessibility can be viewed as the "ability to access" and benefit from some system or entity. The concept focuses on enabling access for people with disabilities, or enabling access through the use of assistive technology; however, research and development in accessibility brings benefits to everyone.

Accessibility is not to be confused with usability, which is the extent to which a product (such as a device, service, or environment) can be used by specified users to achieve specified goals with effectiveness, efficiency, convenience satisfaction in a specified context of use.

Accessibility is strongly related to universal design which is the process of creating products that are usable by people with the widest possible range of abilities, operating within the widest possible range of situations. This is about making things accessible to all people (whether they have a disability or not).Explanation:

4 0
2 years ago
Compare Fibonacci (recursion vs. bottom up)
ipn [44]

Answer:

C++ code explained below

Explanation:

#include<bits/stdc++.h>

#include <iostream>

using namespace std;

int FiboNR(int n)

{

int max=n+1;

int F[max];

F[0]=0;F[1]=1;

for(int i=2;i<=n;i++)

{

F[i]=F[i-1]+F[i-2];

}

return (F[n]);

}

int FiboR(int n)

{

if(n==0||n==1)

return n;

else

return (FiboR(n-1)+FiboR(n-2));

}

int main()

{

long long int i,f;

double t1,t2;

int n[]={1,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75};

cout<<"Fibonacci time analysis ( recursive vs. non-recursive "<<endl;

cout<<"Integer FiboR(seconds) FiboNR(seconds) Fibo-value"<<endl;

for(i=0;i<16;i++)

{

clock_t begin = clock();

f=FiboR(n[i]);

clock_t end = clock();

t1=double(end-begin); // elapsed time in milli secons

begin = clock();

f=FiboNR(n[i]);

end = clock();

t2=double(end-begin);

cout<<n[i]<<" "<<t1*1.0/CLOCKS_PER_SEC <<" "<<t2*1.0/CLOCKS_PER_SEC <<" "<<f<<endl; //elapsed time in seconds

}

return 0;

}

7 0
2 years ago
A palindrome number is a number that remains the same when its digits are reversed. Like 16461, for example, is a palindrome num
xxMikexx [17]

Answer:

Code is given below and output is attached as an image.

Explanation:

#include <iostream>

#include <fstream>

using namespace std;

bool isPalindrome(int n)

{

       // Find reverse of n

       int rev = 0;

       for (int i = n; i > 0; i /= 10)

               rev = rev * 10 + i % 10;

       // If n and rev are same,then n is a palindrome

       return (n == rev);

}

int main()

{

       int min = 1;        // Lower Bound

       int max = 200;      // Upper Bound

       ofstream myfile;

       myfile.open("palindrome.txt");

       for (int i = min + 1; i < max; i++)

               if (isPalindrome(i))

                       myfile << i << endl;

       myfile.close();

       return 0;

}

5 0
3 years ago
What statement is accurate in regards to
lorasvet [3.4K]

The statement that is accurate in regards to sharing workbooks is that You must add the feature to the Quick Access Toolbar

<h3>What does a shared workbook implies?</h3>

The term connote the act of sharing an Excel file. Here, a person can give other users any form of access to the same document.

Sharing workbook is one that allow people to make any kinds of edits at the same time, which saves a person the trouble of keeping track of different versions.

Learn more about workbooks from

brainly.com/question/5450162

7 0
1 year ago
Which selection below lists two operating systems that include BitLocker? A. Windows XP Professional and Windows 7 Professional
Leona [35]
It will be the windows 8 professional
3 0
3 years ago
Other questions:
  • To keep your emails concise and to the point
    13·1 answer
  • Which technology forms the foundation for cloud computing? forms the foundation for cloud computing.
    12·2 answers
  • In the Dynamic Partitioning technique of memory management, the placement algorithm that scans memory from the location of the l
    11·1 answer
  • Given the variable ip, already declared as a pointer to an integer, write the code to dynamically allocate memory for a single i
    15·1 answer
  • The primary function of application software is to apply the power of the computer to enable people, workgroups, and the entire
    7·1 answer
  • I need help getting earbuds please help
    11·2 answers
  • Pick one of the following scenarios and
    6·1 answer
  • When you pass a double variable to a method, the method receives ______.a) a copy of the memory addressb) the reference of the v
    12·1 answer
  • What is the value of the variable result after these lines of code are executed? &gt;&gt;&gt; a = 5 &gt;&gt;&gt; b = 2 &gt;&gt;&
    8·2 answers
  • Explain how mobile phone production could be more sustainable​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!