please, Answer all questions and give a detailed
explanation.
Answer 1:
OUTPUT:
2
CODE (WITH COMMENTS):
Answer 2:
OUTPUT:
1
CODE (WITH COMMENTS):
Answer 3:
OUTPUT:
15
CODE (WITH COMMENTS):
Answer 4:
OUTPUT:
welp
CODE (WITH COMMENTS):
please, Answer all questions and give a detailed explanation. What is output by the following? class...
What is the output for the following program codes? a) [ 0.5 Mark ] class A { int i; } class B extends A { int j; void display() { super.i = j + 1; System.out.println(j + " " + i); }} class inheritance { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); }} OUTPUT: b) [ 0.5 Mark ] class Parent { public void getBike(){ System.out.println("Suzuki Bike"); }} class Child extends Parent {...
output
What is the output of the following: class Access public int x; private int y public void cal(int x, int y) { this.x = x + 1; this.y = y; } public void print() { System.out.print(""+y); } } class AccessSpecifier { public static void main(String args[]) { Access obj = new Access(); obj.cal(2, 3); System.out.print(obj.x); obj.print(); } } 33 Compilation error 23 None of the available choices Runtime error
Please help with the explanation of the of the following code's output: public class ArrayTest { public static void main(String[] args) { int [][] myArray = {{3,4},{}}; System.out.print(myArray.length + " "); System.out.print(myArray[0].length + " "); System.out.print(myArray[1].length + " "); System.out.print(myArray[0][0] + " "); Output = 2 2 0 3 Please justfiy this code's output.
C++ output
6) What is the exact output of the following program? #include <iostream> using namespace stdi void zolo(int &a, int sb) int main int x = 5, y =8; zolo(x,y)i cout << "x " << x << endl ; cout << "y = "" << y << endl ; return o: void zolo(int &a, int &b) int v1 = b + a; ' int v2 = b-a; 3 a=v1;13
What is the output of the following code? Explain your answer. public class Test {public static void main (String [] args) {System.out. print((int) 5.6); System.out.println((int) 5.2);}}
What output is produced by the following program? public class MysteryNums public static void main(String[] args) - int x = 12; int y = x - 3; 3, sentence (y, x + y); . public static void sentence (int numi, int num2) { 4: System.out.println(num1 + " + num2);
What does the program print, and if possible can you give an
explanation of how you reached the answer?
. What will the following program print? class Quiz03 public static void main (String [] args) final int limit = 5; ( string line""i string line = "" ; for ( int j=1 ; j <= row; j++ ) for int row=1; row<=limit; row++ ) line += "*" ; System.out.println( line
Find Output. Just output. No explanation needed.. #include <iostream> #include <string> using namespace std; class baseClass { public: void print() const; baseClass(string s = " ", int a = 0); //Postcondition: str = s; x = a; protected: int x; private: string str; }; class derivedClass: public baseClass { public: void print() const; derivedClass(string s = "", int a = 0, int b = 0); //Postcondition: str = s; x = a; y = b; private: int y; }; int...
C++ OBJECT ORIENTED PROGRAMMING
12. What will be the output of the following C++ code? #include <iostream> #include <vector> using namespace std; int main() { vector<int> myvector; myvector.push_back(78); myvector.push_back(16); myvector.front() += myvector back(); cout << myvector.front() << '\n'; return 0; } a) 78 b) 16 c) 94 d) 86 13. What is the syntax of class template? a) template <paramaters> class declaration b) Template <paramaters> class declaration c) temp <paramaters> class declaration d) Temp <paramaters> class declaration sums the values...
What is the output of the expression 60%3, which makes use of the modulo operator? Answer: Answer When new data are to be inserted into a data structure, but there is no available space; this situation is usually called... Select one: a. Underfow b. Overfow c. None of the above d. Saturated e. Housefull What is the output of the following program? #include <iostream> using namespace std; class Student public: double mathematics; double physics; double biology; }; int main({ Student...