Answer:
The correct answer is option A
Explanation:
Solution
Recall that:
From the question stated,the following segments of code that should be used in replacing the /* missing code */ so that the value 20 will be printed is given below:
Android a = new Android(x);
a.setServoCount(y);
System.out.println(a.getServoCount());
The right option to be used here is A.
This will be stored as a collection of files
Answer: False
Explanation:Decision tree is the tree like structured flowchart which is used for the evaluation of the possible outcomes or result of the particular problem. It usually has two or more branches as the the result node . Decision tree are applicable to many problems for solving it. So, decision trees is not only applicable on certainty problems but also on other problems as well. Therefore the given statement is false.
Answer:
#include <stdio.h>
int hexToDec(const int hexNum[]){
int result = 0, prod = 1;
for(int i = 3;i>=0;i-=1){
result += (prod*hexNum[i]);
prod = prod * 16;
}
return result;
}
int main()
{
int hexNum[4], i;
char s[5], ch;
printf("Enter hexa decimal value: ");
scanf("%s",s);
for(i = 0;i<4;i++){
ch = s[i];
if(ch>='0' && ch<='9'){
hexNum[i] = ch-'0';
}
else if((ch>='a' && ch<='f') || (ch>='A' && ch<='F')){
if(ch=='A' || ch=='a'){
hexNum[i] = 10;
}
else if(ch=='B' || ch=='b'){
hexNum[i] = 11;
}
else if(ch=='C' || ch=='c'){
hexNum[i] = 12;
}
else if(ch=='D' || ch=='d'){
hexNum[i] = 13;
}
else if(ch=='E' || ch=='e'){
hexNum[i] = 14;
}
else{
hexNum[i] = 15;
}
}
}
printf("%d",hexToDec(hexNum));
return 0;
}
Explanation: