Which of the following IS a legal identifier?5_and_10Five_&_Ten______lovepotion#9"hello world"
  • _____
  • mightBePrime
  • hasFever
  • 7th heaven*** can not start with a number
ASSIGNMENTSGiven an integer variable drivingAge that has already been declared, write a statement that assigns the value 17 to drivingAge .Write a statement to set the value of num to 4 (num is a variable that has already been declared).Given two integer variables num and highest, write a statement that gives highest the same value that num has.Given two integer variables oldRecord and newRecord , write a statement that gives newRecord the same value that oldRecord has.Given two integer variables matricAge and gradAge , write a statement that gives gradAge a value that is 4 more than the value of matricAge .Write a statement to add the values of x and y together, storing the result in sum. (The variables have already been declared and x and y have already been initialized.)
  • int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
  • int age;age=15;int weight;weight=90;
  • jtemp = j;itemp=i;j= itemp;i=jtemp;
  • 1. drivingAge = 17;2. num =4;3. higest = num;4. newRecord = oldRecord;5. gradAge = matricAge + 4;6. sum=x+y;
Declare two integer variables named profitStartOfQuarter and cashFlowEndOfYear .
  • int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
  • int count;int age;int weight;int degreesCelsius;
  • 7th heaven*** can not start with a number
  • int profitStartOfQuarter;int cashFlowEndOfYear;
Which of the following is NOT a legal identifier?outrageouslyAndShockinglyLongRun_42_loveportionnumber97thheaven
  • 7th heaven*** can not start with a number
  • _____
  • int age;age=15;int weight;weight=90;
  • int count;int age;int weight;int degreesCelsius;
*** Given two int variables, firstPlaceWinner and secondPlaceWinner , write some code that swaps their values. Declare any additional variables as necessary, but do not redeclare firstPlaceWinner and secondPlaceWinner .
  • jtemp = j;itemp=i;j= itemp;i=jtemp;
  • int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
  • temp = i;i=j;j=temp;
  • int profitStartOfQuarter;int cashFlowEndOfYear;
**** Given three already declared int variables, i , j , and temp , write some code that swaps the values in i and j . Use temp to hold the value of i and then assign j 's value to i . The original value of i , which was saved in temp , can now be assigned to j .
  • temp = i;i=j;j=temp;
  • jtemp = j;itemp=i;j= itemp;i=jtemp;
  • int age;age=15;int weight;weight=90;
  • int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
A location in memory used for storing data and given a name in a computer program is called a _____ because the data in the location can be changed.
  • declared
  • variable
  • hasFever
  • mightBePrime
Write declaration statements to declare and initialize two variables: one is an integer variable named age, initialized to 18, and the other variable, named weight, is initialized to 114.5.
  • int age;age=15;int weight;weight=90;
  • 7th heaven*** can not start with a number
  • int age;age= 18;float weight;weight=114.5;
  • int count;int age;int weight;int degreesCelsius;
0:0:1



Answered

Not Answered

Not Visited
Correct : 0
Incorrect : 0