Explanation:
A binary number is converted to hexadecimal number by making a group of 4 bits from the binary number given.Start making the group from Least Significant Bit (LSB) and start making group of 4 to Most Significant (MSB) or move in outward direction.If the there are less than 4 bits in last group then add corresponding zeroes to the front and find the corresponding hexadecimal number according to the 4 bits.For example:-
for this binary number 100111001011011.
100 11100101 1011
There is one bits less in the last group so add 1 zero(0) to it.
0100 1110 0101 1011
4 E 5 B
100111001011011 = 4E5B
101011.1010
0010 1011 . 1010
2 B A
=2B.A
Answer:
Hi!
The answer coded in Javascript is:
function minimalNumbersOfBanknotes(input) {
var banknotes = [50, 20, 10, 5, 1];
var output = '';
//Each while writes on output variable the banknote and substract the same quantity on input variable.
//If the input is lesser than the value of while banknote, step into next while.
for (var i = 0; i < banknotes.length; i++) {
while(input >= banknotes[i]) {
output = output + ' ' + banknotes[i];
input = input - banknotes[i];
}
}
return output;
}
Answer:
#include<iostream>
using namespace std;
//create the function which add two number
void addTwoNumber(int num_1,int num_2)
{
int result = num_1 + num_2; //adding
cout<<"The output is:"<<result<<endl; //display on the screen
}
//main function
int main(){
//calling the function
addTwoNumber(3,6);
return 0;
}
Explanation:
First, include the library iostream for using the input/output instructions.
then, create the function which adds two numbers. Its return type is void, it means the function return nothing and the function takes two integer parameters.
then, use the addition operation '+' in the programming to add the numbers and store the result in the variable and display the result.
create the main function for testing the function.
call the function with two arguments 3 and 6.
then, the program copies the argument value into the define function parameters and then the program start executing the function.
In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)
then, each time you find that charat, spc++.
also, the string must be declared in the main method, not the spaces count method.
The actual code:
public class CountSpaces{
public static void main(String[] args){
String instring = "(your quote here)";
int spaces = calculateSpaces(instring);
System.out.println("The number of spaces is " + spaces);
}
public static int calculateSpaces(String in){
int spc = 0;
for(int i= 0; i<in.length; i++){
if(in.charAt(i)== ' '){
spc++;
}
}
return spc;
}
}
that should be it. If you have any questions, feel free to reach out.
Answer:
Earned Value Management (Even)
Explanation:
Even is the best management tool for monitoring the performance of a project by emphasizing the planning and integration of program cost.
Answer:
Given Data:
Clock rate of P1 = 4 GHz
Clock rate of P2 = 3 GHz
Average CPI of P1 = 0.9
Number of Instructions = 5.0E9 = 5 × 10^9
Clock rate of P2 = 3 GHz
Average CPI of P2 = 0.75
Number of Instructions = 1.0E9 = 10^9
To find: If the computer with largest clock rate has the largest performance?
Explanation:
Solution:
As given in the question, clock rate of P1 = 4 GHz which is greater than clock rate of P2 = 3 GHz
According to the performance equation:
CPU Time = instruction count * average cycles per instruction/ clock rate
CPU Time = I * CPI / clock rate
Where instruction count refers to the number of instructions.
Performance of P1:
CPU Time (P1) = 5 * 10^9 * 0.9 / (4 * 10^9)
= 5000000000 * 0.9 / 4000000000
= 4500000000 / 4000000000
= 1.125s
Performance of P2:
CPU Time (P2) = 10^9 * 0.75/ (3 * 10^9)
= 750000000 / 3000000000
= 0.25s
So the Performance of P2 is larger than that of P1,
performance (P2) > performance (P1)
0.25 is better than 1.125
But clock rate of P1 was larger than P2
clock rate of P1 > clock rate of P2
4 GHz > 3 GHz
So this is a misconception about P1 and P2.
It is not true that computer with the largest clock rate as having the largest performance.