1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
steposvetlana [31]
3 years ago
13

Convert the following hexadecimal numbers to decimal: a) 0xE4 b) 0x3AC c) 0xFF

Computers and Technology
1 answer:
creativ13 [48]3 years ago
6 0

Answer:

a) 228

b) 940

c) 255

Explanation:

To convert a hexadecimal number to decimal, multiply each hex digit by 16^(position-1) and add the components.

For example, 0x 34 = 3* 16^(2-1) + 4*16^(1-1) = 48 + 4 = 52

Evaluating the given numbers:

a) 0xE4 =>

E corresponds to 14. So the decimal representation is 14*16 + 4 = 228

b) 0x3AC =>

A corresponds to 10 and C to 12. So the decimal representation is 3*16^2 + 10*16 + 12 = 940

c) 0xFF =>

F corresponds to 15. So the decimal representation is 15*16 + 15 = 255

You might be interested in
Purple gang or green gang?
zhuklara [117]

Answer:

Purple?

Explanation:

8 0
3 years ago
Read 2 more answers
Write a program that uses a scanner to report some statistics about words in an input sentence ( see Section 7.8). The outputs s
Alla [95]

import java.util.Scanner;

public class JavaApplication77 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = scan.nextLine();

       String [] arr = new String[sentence.length()];

       arr = sentence.split(" ");

       System.out.println("There are "+arr.length+" words in the sentence.");

       int count = 0;

       for(int i = 0; i < arr.length; i++){

           count += arr[i].length();

       }

       System.out.println("The average length of a word in your sentence is "+(count/arr.length)+" characters");

       count = 0;

       System.out.println("Your sentence is "+sentence.length()+" characters long.");

       

   }

   

}

For the length of a sentence, I included spaces as characters but I did not do this for the length of a word. I hope this helps!

8 0
3 years ago
A loop should output 1 to n. If n is 5, the output is 12345. What should XXX and YYY be? Choices are in the form XXX / YYY. cin
Alona [7]

Answer:

i = 0; i < n / i + 1

Explanation:

Given that:

a loop output 1 → n

if n = 5

output = 12345

n = scnr.nextInt();

for (XXX;  i++)

{

System.out.printIn(YYY);

}

XXX / YYY is i = 0; i < n / i + 1

5 0
3 years ago
Read 2 more answers
ÍS THERE ANY TECH GUY OR SOMEONE WHO UNDESTAND ABOUT UNINSTALLING?
marysya [2.9K]
Well, dont know ;-: PROBLEM?
6 0
3 years ago
The ability to write functions is one of the more powerful capabilities in C++. Functions allow code to be reused, and provides
Lunna [17]

Answer:

The header file in C++ is as follows

myFunction.h

void max(int a, int b)

{

if(a>b)

{

 std::cout<<a;

}

else

{

 std::cout<<b;

}

<em>}</em>

The Driver Program is as follows:

#include<iostream>

#include<myFunction.h>

<em>using namespace std;  </em>

int main()

{

int m,n;

cin>>m;

cin>>n;

max(m,n);

<em>}</em>

Explanation:

It should be noted that, for this program to work without errors, the header file (myFunction.h) has to be saved in the include directory of the C++ IDE software you are using.

For instance; To answer this question I used DevC++

So, the first thing I did after coding myFunction.h is to save this file in the following directory  ..\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include\

Back to the code

myFunction.h

void max(int a, int b)  {

-> This prototype is intialized with integer variables a and b

if(a>b)  -> If the value of a is greater than b;

{

 std::cout<<a;  -> then the value of variable a will be printed

}

else

-> if otherwise,

{

 std::cout<<b;

-> The value of b will be printed

}

}

Driver File (The .cpp file)

#include<iostream>

#include<myFunction.h>  -> This line includes the uesr defined header

using namespace std;  

int main()

{

int m,n;  -> Two integer variables are declared

      cin>>m;  -> This line accepts first integer input

      cin>>n;  -> This line accepts second integer input

max(m,n);

-> This line calls user defined function to return the largest of the two integer variables

}

6 0
3 years ago
Other questions:
  • Which class of fire extinguisher is appropriate for a fire involving electrical/energized electrical equipment?
    13·2 answers
  • Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long
    6·1 answer
  • You wish to lift a 12,000 lb stone by a vertical
    7·1 answer
  • Which of these organs is not found in the excretory system
    7·2 answers
  • Python is an example of a low level programming language true or false?​
    14·1 answer
  • The first step to keeping your home safe is to minimize the overall amount of _______________ materials you store in your home.
    13·1 answer
  • Explain block diagram of. computer architure​
    5·1 answer
  • Can someone please give me the 3.6 code practice answer I will mark you brainlyist
    13·1 answer
  • The most important preinstalled software is the ______ software that allows you to use the computer the first time you turn it o
    7·1 answer
  • Mel is a research scientist at a health sciences center. His job requires him to analyze large amounts of data in short periods
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!