MCQExams
0:0:1
CBSE
JEE
NTSE
NEET
Practice
Homework
×
practice
Cp 120 Chp2.1 Quiz
Which of the following IS a legal identifier?5_and_10Five_&_Ten______lovepotion#9"hello world"
Report Question
0%
_____
0%
mightBePrime
0%
hasFever
0%
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.)
Report Question
0%
int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
0%
int age;age=15;int weight;weight=90;
0%
jtemp = j;itemp=i;j= itemp;i=jtemp;
0%
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 .
Report Question
0%
int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
0%
int count;int age;int weight;int degreesCelsius;
0%
7th heaven*** can not start with a number
0%
int profitStartOfQuarter;int cashFlowEndOfYear;
Which of the following is NOT a legal identifier?outrageouslyAndShockinglyLongRun_42_loveportionnumber97thheaven
Report Question
0%
7th heaven*** can not start with a number
0%
_____
0%
int age;age=15;int weight;weight=90;
0%
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 .
Report Question
0%
jtemp = j;itemp=i;j= itemp;i=jtemp;
0%
int i;i=firstPlaceWinner;firstPlaceWinner = secondPlaceWinner;secondPlaceWinner = i;
0%
temp = i;i=j;j=temp;
0%
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 .
Report Question
0%
temp = i;i=j;j=temp;
0%
jtemp = j;itemp=i;j= itemp;i=jtemp;
0%
int age;age=15;int weight;weight=90;
0%
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.
Report Question
0%
declared
0%
variable
0%
hasFever
0%
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.
Report Question
0%
int age;age=15;int weight;weight=90;
0%
7th heaven*** can not start with a number
0%
int age;age= 18;float weight;weight=114.5;
0%
int count;int age;int weight;int degreesCelsius;
0:0:1
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
0
Answered
0
Not Answered
0
Not Visited
Correct : 0
Incorrect : 0
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqexams.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page