ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 8.00

Given the following code and flag = 2

(TCO 3) Given the following code and flag = 2, what is the value of x after the code executes?
 
int x = 0;   
switch (flag)
{
case 0:
       x++;
       break;
case 1:
case 2:
       x++;
case 3:
       x++;
       break;
case 4:
       x++;
case 5:
case 6:
       x++;
case 7:
       x++;
       break;
default:
       break;
} (Points : 5)
       x
will be 0.
       x
will be 1.
       x
will be 2.
       x
will be 3.

 

Question 2.2. (TCO 8) Which is the command used to open a file? (Points : 5)
       ifstream myFile;
       ofstream myFile;
       myFile.open("file.txt");
       myFile.access("file.txt");.

 

Question 3.3. (TCO 6) Given the following two-dimensional array initialization, which value is stored in myArray[3][2]?


       // Create an array with std::array
       array <array <int, COLUMN>, ROW> myArray =
       {{
             {1,2,3,4,5},
             {10,20,30,40,50},
             {100,200,300,400,500},
             {6,7,8,9,0}
}}; (Points : 5)
       10
       30
       200
       2

 

Question 4.4. (TCO 5) From the list below, which is a function prototype? (Points : 5)
       int myFunc( int);
       int myFunc(int x)
   {
       return 2*x;
   }
       y = myFunc(3);
       int myFunc(int){}

 

Question 5.5. (TCO 5) In the code below, which is the value of x after the program returns from y=myfunc(x);?


#include <iostream>
#include <string>
 
using namespace std;
 
//******Function Prototypes******
int myFunc(int);
 
//******End of Function Prototypes******
 
//-------------------------------
//******Program starts here******
//-------------------------------
int main()
{
       int x =6;
       int y =0;
       y = myFunc(x);
       // Wait for user input to close program when debugging.
       cin.get();
       return 0;
}
//******End of Main******
 
//******Function Definitions******
int myFunc(int x)
{
       int j = 2*x;
       x = 2*j;
       return j;
}
//******End of Function Defintions****** (Points : 5)
       0
       12
       6
       24

 

Answers

(11)
Status NEW Posted 24 May 2017 06:05 AM My Price 8.00

-----------

Attachments

file 1495608805-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)