In the following statement:
foo = 'C' + 1;
Which of the following could be a valid data type for the variable foo?
(More than one may be correct)
1) int
2) char
3) none of the above
We can use both 'int' and 'char' data type for the variable foo.
1) int
2) char
In the following statement: foo = 'C' + 1; Which of the following could be a...
1) In the Quiz class, the foo method has the following API: public void foo( int x, String s) Which method call(s) would be correct assuming both a and y are integer values and assuming each statement is complete? a. Quiz q = new Quiz(); a = q.foo( y, “Maybe?” ); b. Quiz q = new Quiz(); q.foo( 1, “Hmmm!” ); c. Quiz q = new Quiz(); Quiz.foo( y, “You think” ); d. Both b and c 2) In the...
1. After the declaration: typedef struct { int part1; int part2; } Foo; Group of answer choices Foo is a new data type which can be used to declare variables of this new type that holds two integers Foo is a variable which holds a pointer to this new type that holds two integers Foo is a variable which holds this new type that holds two integers None of the above choices are correct 2. After the declaration: typedef struct...
In the Quiz class, the foo method has the following API: public double foo(int i, String s, char c) What is the return type of the method foo? Int, Double, Char, String
Which of the following is a valid function call to the function foo. (Assume that foo has be declared elsewhere in the code.) foo; foo(); foo x, y; int foo();
In the Quiz class, the foo method has the following API : public static double foo( int i, string s, char c) how many arguments does foo take? is it 3 right? What is the output of this code sequence? int a = Math.min( 5, 8 ); System.out.println( a ); What is the output of this code sequence? System.out.print( Math.round( 3.5 ) ); What is the output of this code sequence? double d = Math.pow( 2, 3 ); System.out.println( d...
which of the following i.. INVALID identifier in C? A. hot do 1 B. 2ab С.cat1 D. pri 2. Assuming int an, boos which of the following statement avigns b a different value from others A. b a/2 B. b-64--a) D. b a>372:1 3. What's the correct output of the following code int m-1 printtoidm-2) A. 000 B. 123 C. 012 D. None of above 4. What's the output of following code: char str [15]."hello!"; printf( idin",strlen(str)) A. 6 B....
Unix and C 1) Which of the following command(s) can be used to check if the string "aabbcc" matches a pattern described by regex "aa.*" or not? (a) expr "aabbcc": 'aa.*" (b) echo "aabbccegrep 'aa.*' (c) expr match "aabbcc" 'aa.*" (d) egrep 'aa.*"< END aabbcc END 2) Which of the following is legal directives in C? (a) #include<stdio.h> (b) #include <stdio.h> (c) #include stdio.h (d) include stdio.h 3) If c is a variable of type char and i is a...
Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...
Given the following Java code: class C { public int foo(C p) { return 1; } } class D extends C { public int foo(C p) { return 2; } public int foo(D p) { return 3; } } C p = new C(); C q = new D(); D r = new D(); int i = p.foo(r); int j = q.foo(q); int k = q.foo(r); (Remember that in Java every object is accessed through a pointer and that methods...
C programming Given an integer variable declared as int result, which of the following choices set result = 2? Each choice may contain a single statement or a group of statements. Select all choices you believe are correct--this question may have more than one correct answer! A. double temp = 19.0; int div = 10; result = 1 + temp / div; B. double val1 = 3; double val2 = 0.75; result = val1 / 2 + val2 * 2; C....