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
adell [148]
3 years ago
6

Convert each of the fo" wing base ten representations to its equivalent binary form a. 6 b. 13 C. d. 18 e. 27

Computers and Technology
1 answer:
asambeis [7]3 years ago
6 0

Answer:

6=110

13=1101

18=10010

27=11011

Explanation:

A decimal number is converted to binary number by constantly dividing the decimal number by 2 till the number becomes zero and then write the remainders in reverse order of obtaining them.Then we will get our binary number.

I will provide you 1 example:-

18/2 = 9   the  remainder =0

9/2 = 4    the remainder =1

4/2 = 2    the remainder =0

2/2 = 1     the remainder =0

1/2 = 0     the remainder =1

Writing the remainder in reverse order 10010 hence it is the binary equivalent of 18.

You might be interested in
​_______ consists of the analysis​ tools, technologies, and processes by which marketers dig out meaningful patterns in big data
Salsk061 [2.6K]
I think it's value chain analysis.
7 0
3 years ago
Write a C++ program to find if a given array of integers is sorted in a descending order. The program should print "SORTED" if t
LenKa [72]

Answer:

The cpp program for the given scenario is as follows.

#include <iostream>

#include <iterator>

using namespace std;

int main()

{

   //boolean variable declared and initialized  

   bool sorted=true;

   //integer array declared and initialized

   int arr[] = {1, 2, 3, 4, 5};

   //integer variables declared and initialized to length of the array, arr

   int len = std::end(arr) - std::begin(arr);

       //array tested for being sorted

    for(int idx=0; idx<len-1; idx++)

    {

        if(arr[idx] < arr[idx+1])

           {

               sorted=false;

            break;

           }

    }

    //message displayed  

    if(sorted == false)

     cout<< "UNSORTED" <<endl;

 else

    cout<< "UNSORTED" <<endl;

return 0;

}

OUTPUT

UNSORTED

Explanation:

1. An integer array, arr, is declared and initialized as shown.

int arr[] = {1, 2, 3, 4, 5};

2. An integer variable, len, is declared and initialized to the size of the array created above.

int len = std::end(arr) - std::begin(arr);

3. A Boolean variable, sorted, is declared and initialized to true.

bool sorted=true;  

4. All the variables and array are declared inside main().

5. Inside for loop, the array, arr, is tested for being sorted or unsorted.  The for loop executes over an integer variable, idx, which ranges from 0 till the length of the array, arr.

6. The array is assumed to be sorted if all the elements of the array are in descending order.

7. If the elements of the array are in ascending order, the Boolean variable, sorted, is assigned the value false and for loop is exited using break keyword. The testing is done using if statement.

8. Based on the value of the Boolean variable, sorted, a message is displayed to the user.

9. The program can be tested for any size of the array and for any order of the elements, ascending or descending. The program can also be tested for array of other numeric data type including float and double.

10. All the code is written inside the main().

11. The length of the array is found using begin() and end() methods as shown previously. For this, the iterator header file is included in the program.

4 0
3 years ago
Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtractio
Mariulka [41]

Answer:

class Example:

def __init__(self, val):

self.val = val

def __gt__(self, other):

return self.val > other.val

def __sub__(self,other):

return abs(len(self.val) - len(other.val))

def main():

obj1 = Example('this is a string')

obj2 = Example('this is another one')

print(obj1 > obj2)

print(obj1 - obj2)

main()

\color{red}\underline{Output:}

3 0
3 years ago
Why is transmitting information through computers cheap and fast
Novay_Z [31]

<em>Hey there!</em>

Just to be corny, what does a spider use to navigate the internet? <em>The World Wide Web!  </em>Did you catch that? Hopefully you did...

Anyway, enough with my jokes, here's your answer.

Transmitting information through computers are cheap and fast because of multiple things. The first reason is because they don't require a deliverer or shipping. They can literally be sent from anywhere and be delivered within 10 seconds-5 minutes, way faster than any mailman or delivery. How does it move that fast? Smaller files tend to move quicker among the invisible online delivery lines, most commonly known as cell towers. To get online info from your phone/computer to someone else's device, the file bounces from tower to tower to finally reach the destination.

<em>I'm always open to any question or comment!</em>

<em>God Bless!</em>

<em>-X8lue83rryX</em>

5 0
3 years ago
Write a program that asks the user to enter a date in MM/DD/YYYY format that is typical for the US, the Philippines, Palau, Cana
stepladder [879]

Answer:

In Python:

txt = input("Date in MM/DD/YYYY format: ")

x = txt.split("/")

date=x[1]+"."

if(int(x[1])<10):

   if not(x[1][0]=="0"):

       date="0"+x[1]+"."

   else:

       date=x[1]+"."

   

if(int(x[0])<10):

   if not(x[0][0]=="0"):

       date+="0"+x[0]+"."+x[2]

   else:

       date+=x[0]+"."+x[2]

else:

   date+=x[0]+"."+x[2]

   

print(date)

Explanation:

From the question, we understand that the input is in MM/DD/YYYY format and the output is in DD/MM/YYYY format/

The program explanation is as follows:

This prompts the user for date in MM/DD/YYYY format

txt = input("Date in MM/DD/YYYY format: ")

This splits the texts into units (MM, DD and YYYY)

x = txt.split("/")

This calculates the DD of the output

date=x[1]+"."

This checks if the DD is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[1])<10):

If true, this checks if the first digit of DD is not 0.

   if not(x[1][0]=="0"):

If true, the prefix 0 is added to DD

       date="0"+x[1]+"."

   else:

If otherwise, no 0 is added to DD

       date=x[1]+"."

   

This checks if the MM is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[0])<10):

If true, this checks if the first digit of MM is not 0.

   if not(x[0][0]=="0"):

If true, the prefix 0 is added to MM and the full date is generated

       date+="0"+x[0]+"."+x[2]

   else:

If otherwise, no 0 is added to MM and the full date is generated

       date+=x[0]+"."+x[2]

else:

If MM is greater than 10, no operation is carried out before the date is generated

   date+=x[0]+"."+x[2]

This prints the new date

print(date)

8 0
3 years ago
Other questions:
  • Elvis has asked Bonnie out on a date to a baseball game. Elvis is a friend of Bonnie's classmate Ginger and she has met him a fe
    5·2 answers
  • Why process scheduling is needed in a uni-processor system?
    12·1 answer
  • CHALLENGE ACTIVITY 2.15.1: Reading and outputting strings. Write a program that reads a person's first and last names, separated
    11·1 answer
  • What happens if you never confirm your facebook account?
    8·1 answer
  • A computer is an electronic device operating under the control of instructions stored in its own memory that can accept, manipul
    11·1 answer
  • The emergence of MP3 (iPod) technology is an example of creative destruction because a. It is less expensive than compact discs
    14·1 answer
  • An attacker is intent on disturbing the communication by inserting bogus packets into the communications.
    9·1 answer
  • What is multimedia computer system​
    7·1 answer
  • Program a substitution cipher in Python. Create 2 functions one for encryption and the other for decryption ( get the text as th
    8·1 answer
  • Can anyone fix this code for me?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!