Question

In: Computer Science

PLEASE ANSWER AS MANY AS YOU CAN, BUT TRY TO FINISH THEM ALL In a switch...

PLEASE ANSWER AS MANY AS YOU CAN, BUT TRY TO FINISH THEM ALL

  1. In a switch statement, the expression following the word case can be a variable

    1. True

    2. False

4. Assume C is a char variable, the following statement will read a space character into c when the user enters a space character and presses the enter/ return key.

cin >> c;

  1. True

  2. False

5. Which statement will read an entire line of input into the following string object?

string address;

  1. getline (cin, address) ;

  2. cin >> address;

  3. None of these

  4. cin

  5. cin. get (address) ;

6. Assume a and b are two bool variables, which is an equivalent of the following expression?

!(a || b)

  1. !a||b

  2. None of these

  3. !a||!b

  4. !a&&!b

7. This manipulator is used to establish a field width for the value immediately following it:

  1. field_width

  2. iomanip

  3. setw

  4. set_field

  5. None of these


8. Given the following code segment, what is output after “result =” ?

intx=1, y=0, z=1;

y=y+z;

x=x+y;

cout << “result= ”

      <<( y<x? y : x)

      << endl;

  1. 3

  2. None of these

  3. 1

  4. 0

  5. 2

9. What will the following segment of code output?

score =40;

if (score >95)

        cout<< “Congratulations!\n”;

        cout << “Thats a high score!\n”;

     cout << “This is a test question!” << endl;

  1. That’s a high score!

This is a test question!

  1. NONE OF THESE

  2. Congratulations!

That’s a high score!

  1. Congratulations!

That’s a high score!

This is a test question!

I WILL UPVOTE, PLEASE HELP


Solutions

Expert Solution

Q:-3 In a switch statement, the expression following the word case can be a variable.

  • True
  • False

Answer:-----
True

4. Assume C is a char variable, the following statement will read a space character into c when the user enters a space character and presses the enter/ return key.

cin >> c;

  • True
  • False

Answer:-----
True

5. Which statement will read an entire line of input into the following string object?

string address;

getline (cin, address) ;

cin >> address;

None of these

cin

cin. get (address) ;

Answer:-----
getline (cin, address) ;


6. Assume a and b are two bool variables, which is an equivalent of the following expression?

!(a || b)

!a||b

None of these

!a||!b

!a&&!b

Answer:------
!a&&!b

7. This manipulator is used to establish a field width for the value immediately following it:

field_width

iomanip

setw

set_field

None of these

Answer:------
setw

8. Given the following code segment, what is output after “result =” ?

intx=1, y=0, z=1;

y=y+z;

x=x+y;

cout << “result= ”

<<( y<x? y : x)

<< endl;

  • 3
  • None of these
  • 1
  • 0
  • 2

Answer:------
1

9. What will the following segment of code output?

score =40;

if (score >95)

cout<< “Congratulations!\n”;

cout << “Thats a high score!\n”;

cout << “This is a test question!” << endl;

That’s a high score!

This is a test question!

NONE OF THESE

Congratulations!

That’s a high score!

Congratulations!

That’s a high score!

This is a test question!

Answer:---------
That’s a high score!

This is a test question!


Related Solutions

Hello, please try to answer it as accurate as you can because answer accuracy is the...
Hello, please try to answer it as accurate as you can because answer accuracy is the most important. 1_Before a cell undergoes mitotic cell division: a)what has to happen first, regarding its DNA? b)If (what you wrote in 2a) didn’t happen, what problem would arise? 2_There are some cells which after they mature (fully differentiate into their specific cell type) never undergo division (such as heart muscle cells) again. These cells are in what phase? _________ 3_How are phosphates involved...
TRUE OR FALSE? ** IF YOU CAN'T ANSWER THEM ALL, PLEASE DON'T ANSWER ANY** When a...
TRUE OR FALSE? ** IF YOU CAN'T ANSWER THEM ALL, PLEASE DON'T ANSWER ANY** When a company declares of cash dividends retained earnings is reduced. Authorized stock is the total number of shares outstanding. The asset turnover ratio measures how efficiently a company uses its assets to generate sales. Pro forma income usually excludes items that the company thinks are unusual or nonrecurring. Sales minus operating expenses equals gross profit. Freight terms of FOB Destination means that the seller pays...
****Please answer them all, if you cannot, please skip**** Here are scores received by a class...
****Please answer them all, if you cannot, please skip**** Here are scores received by a class of Biology students on a 40 point exam. Each number is the score, out of 40 points, received by one student. The data are separated by gender. Scores, out of 40 points, received by female students: 17, 20, 30, 31, 31, 33.6, 34, 34.5, 35, 35, 36, 35.6, 36, 36, 36, 37, 37.5, 37, 38, 38 Scores, out of 40 points, received by male...
PLEASE ANSWER ALL THE QUESTIONS!!!!!! DO NOT ONLY ANSWER PART OF THE QUESTION. ALSO TRY TO...
PLEASE ANSWER ALL THE QUESTIONS!!!!!! DO NOT ONLY ANSWER PART OF THE QUESTION. ALSO TRY TO ANSWER THE QUESTIONS AS SPECIFIC AS POSSIBLE. SHOW YOUR WORK!!!!! 29.5 1.5 7 27.9 1.175 6 25.9 1.232 6 29.9 1.121 6 29.9 0.988 6 30.9 1.24 7 28.9 1.501 6 35.9 1.225 6 31.5 1.552 6 31 0.975 5 30.9 1.121 6 30 1.02 5 36.9 1.664 8 41.9 1.488 7 40.5 1.376 6 43.9 1.5 7 37.5 1.256 6 37.9 1.69 6...
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1/...
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1/ What is one similarity and one difference between voluntary motor system that innervate the head versus voluntary motor system that innervate the body? 2/ Does olfactory bulb (direct) relay to primary sensory cortex via the thalamus? 3/ Write a short paragraph using the following terms: opiates; endorphins, pain relief. 4/ In your own words, explain one way in which neuroplasticity allows learning and memory...
Can you please answer all questions and please answer as soon as possible THANK YOU 1/...
Can you please answer all questions and please answer as soon as possible THANK YOU 1/ what do you think wernicke’s area of an infant develops prior to Broca’s? 2/ Create a short paragraph using the following terms: fovea, cones, rods, peripheral retina, acuity, center of the visual field? 3/ Why cone receptors are able to send information about different frequencies of light? 4/why do you think it is easier to name a taste in food than a smell in...
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1-...
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1- What is one similarity and one difference between voluntary motor system that innervate the head versus voluntary motor system that innervate the body? 2- Does olfactory bulb (direct) relay to primary sensory cortex via the thalamus? 3- Write a short paragraph using the following terms: opiates; endorphins, pain relief. 4- In your own words, explain one way in which neuroplasticity allows learning and memory...
CAN YOU PLEASE ANSWER ALL QUESTION AND PLEASE ANSWER AS SOON AS POSSIBLE THANK YOU 1....
CAN YOU PLEASE ANSWER ALL QUESTION AND PLEASE ANSWER AS SOON AS POSSIBLE THANK YOU 1. Behavioral activity is prone to a lot of variation; would Open field and Inhibitory Avoidance be valuable Primary and only endpoint measures? Explain why? 2. Lesions of the amygdala made after a delay from training result in partial retention of fear motivated Inhibitory avoidance task. On the other hand, pharmacological manipulations of the amygdala immediately after training abolished the strength of inhibitory avoidance learning....
CAN YOU PLEASE ANSWER ALL QUESTIONS AND PLEASE ANSWER AS SOON AS POSSIBLE 1. The processing,...
CAN YOU PLEASE ANSWER ALL QUESTIONS AND PLEASE ANSWER AS SOON AS POSSIBLE 1. The processing, where different kinds of information are processed in different brain structures, is called: a. Stream segregation b. Serial processing c. Distributed processing d. Parallel processing 2. In vision, what does dark adaptation mean? a. Decrease in color discrimination that occurs after a period in the dark b. The increased sensitivity of the eye that occurs when being in the dark for a long time...
Please answer all of them, Thank you. 1. What are the three equivalent definitions of a...
Please answer all of them, Thank you. 1. What are the three equivalent definitions of a conservative force? Show how they are equivalent. 2. Suppose there is a pendulum with length 5m hanging from a ceiling. A ball of mass 2kg is attached to the bottom of the pendulum. The ball begins at rest. If I give the ball a velocity of 6 m/s, what is the maximum height that the ball will achieve? Use the energy conservation model to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT