Cs124 pratctice
21. which fragment of code accepts a user's address (such as "1600 penn...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 06.10.2019 23:30 SMNS625
Cs124 pratctice
21. which fragment of code accepts a user's address (such as "1600 pennsylvania avenue")?
a. char address;
cin > > address;
c. char address[256];
cin. getline(address, 256);
b. char address;
cin. getline(address);
d. char address[256];
cin > > address;
22. what is the value of a after the following code is executed:
{
bool a = (3 == 'a');
}
a. true
b. false
23. what is the value of b after the following code is executed:
{
bool a = ! (true);
bool b = ! (true & & false) & & a;
}
a. true
b. false
24. what is the value of e after the following code is executed:
{
bool a = (10 < 10);
bool b = ! a;
bool c = a || b;
bool d = c & & (b || a);
bool e = d & & d;
}
a. true
b. false
25. what is the value of a after the following code is executed:
{
bool a = 42;
}
a. true
c. undefined
b. false
d. syntax error
26. what is the output:
{
char a = 'a';
if (a = 'b')
a = 'c';
else
a = 'd';
cout < < a < < endl;
}
a. a
b. b
c. c
d. d
27. which of the following fragments of code will determine whether i have passed a class?
a. bool pass = (grade => 60);
b. bool pass = false;
if (grade < 60)
pass = true;
c. bool pass = < 60));
d. bool pass = true;
if (grade = 60)
pass = false;
28. what is the output:
{
int z = 3;
if (z = 4);
cout < < "error";
cout < < z < < endl;
}
a. error
b. 3
c.
d. error 4
29. what is the output?
void a()
{
cout < < 6;
return;
}
int main()
{
cout < < 3;
a();
cout < < 9;
return 0;
}
a. 39
b. 6
c. 369
d. 639
30. what is the output of the following program:
void subtract(int b, int a)
{
cout < < a - b < < endl;
return;
}
int main()
{
int a = 16;
int b = 12;
subtract(a, b);
return 0;
}
a. 12
c. 16
b. 4
d. -4
31. what is the output?
int two()
{
return 6;
}
int main()
{
int one = 10;
int three = two() + one;
cout < < three < < endl;
return 0;
}
a. 6
b. 10
c. 3
d. 16
32. what is the output?
double z(double b double c)
{
return b - c;
}
int main()
{
cout < < z(20.6 10.2) < < endl;
return 0;
}
a. 30.8
b. 10.4
c. compile error
d. z(20.6, 10.2)
33. what is the output of the following program:
double z(double a1, double a2)
{
return a1 + a2;
}
int main()
{
double a = z(2, 4);
double b = z(a, z(11, 11));
cout < < b < < endl;
return 0;
}
a. 22
c. 28
b. 6
d. 11
34. what is the output of the following program:
int setseven(int value)
{
value = 7;
return value;
}
int main()
{
int value = 6;
setseven(value);
cout < < value < < endl;
return 0;
}
a. value
c. 6
b.
d. 7
35. what is the output of the following program:
void function(int x, int & y)
{
x = 0;
y = 0;
return;
}
int main()
{
int m = 2;
int n = 6;
function(m, n);
cout < < "m == " < < m < < endl
< < "n == " < < n < < endl;
return 0;
}
a. m == 2
n == 6
c. m == 2
n == 0
b. m == 0
n == 0
d. m == 0
n == 6
36. which best describes a computer bus?
a. a device that outputs data to the user or accepts input from the user
c. a chip that moves data from one part of the computer to another
b. the data connection between main memory and the cpu
d. the data connection between the components of a computer
37. if your body was a computer, select all the von neumann functions that the spinal cord would perform.
a. bus
c. memory
b. i/o
d. cpu
38. a digital wrist watch is a computer. which von neumann component is the display?
a. memory
c. bus
b. cpu
d. i/o
39. which part of a compiler breaks a program up into words or tokens?
a. parser
c. linker
b. lexer
d. code generator
40. 3 byte(s) equals
a. 3 bits
d. 12 bits
b. 96 bits
e. 6 bits
c. 24 bits
![ansver](/tpl/images/cats/User.png)
Answers: 2
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 04:00
Which spereadsheet type will determine how well a bussiness has done over the past year
Answers: 1
![question](/tpl/images/cats/informatica.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 04:00
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x,y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documentation/point2d.html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mkx.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/health.png)
Health, 23.02.2021 21:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)