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
xxTIMURxx [149]
3 years ago
12

A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the

bits in the string 1011 two places to the left to produce the string 1110. Note that the leftmost two bits are wrapped around to the right side of the string in this operation. Define two scripts, shiftLeft.py and shiftRight.py, that expect a bit string as an input.
Computers and Technology
1 answer:
Genrish500 [490]3 years ago
8 0

Answer:

Aee explaination

Explanation:

#Implementation of shiftLeft method

#which shifts the bits in its input one

#place to tge left

def shiftLeft(bitstring):

bitstring = bitstring[1:]+bitstring[0]

#return as bit string format

return bitstring

#Get the input from user

bits = input("Enter a string of bits: ")

#call the shiftLeft method which returns the value

# that is stored in leftShift

leftShift = shiftLeft(bits)

#Display the output

print()

print(leftShift)

print()

You might be interested in
1. Here is a program segment to find the quantity base . Both base and exp are entered at the keyboard. System.out.println("Ente
zavuch27 [327]

Answer:

The correct code to this question can be de4fined as follows:

double power;

power = Math.pow(base, exp);

Explanation:

In the given question the choices were missing, that's why we defined the correct code only.

  • In the given code a two double variable "base and exp" is declared, that input the value from the user-side, and store its value into there respective variables.
  • In the next step, "power", that is a double variable is declared, which uses the  "Math.pow" function that calculates given values power and prints its value.

please find the attachment of the full code.

3 0
3 years ago
WILL GIVE BRAINLIEST PLEASE HELP / urgent
Alex Ar [27]
Web design is awesome! Alright, so -

If you want to call some attention to text, you need to focus on the basic essentials. 

You want your text to be brief and split up. If someone goes on your site and see's walls of text, they'll be overwhelmed and leave.

So, to call attention - make it brief, and split it up into nice paragraphs.

Another way to call attention to text is to have a <em>really </em>good colour scheme. Having text easy on the eyes attracts the reader more, and encourages them to dive deeper.

If your text is unattractive and hard to look at it, it'll certainly get their attention - but not the attention you want.

Finally, another way to call attention is with visual adjustments such as making text bold, making it <em>italicised, </em>making it ALL CAPS, <em>or just GOING CRAZY WITH UNNECESSARY TEXT ATTENTION ATTRACTING POWER!!!!!!!

</em>Ahem... Anyways, these are just a few ways to get their attention. =) If you need any other help, private message me because I love web development! =)<em>
</em>
4 0
3 years ago
What engine component is shown in the above Figure?
astra-53 [7]

send attached file with it


5 0
3 years ago
Read 2 more answers
Which of these methods can you use to insert a new row in a worksheet?
vodka [1.7K]

Answer:

I think It should be B

Explanation:

If wrong so please sorry

3 0
3 years ago
Write a C++ program to grade the answers to a true-false quiz given to students in a course. The quiz consists of 5 true-false q
Eddi Din [679]

The quiz program is an illustration of loops and conditional statements

  • Loops are used to perform repetition
  • Conditional statements are used to make decisions

<h3>The quiz program</h3>

The quiz program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

int main(){

   //This prints the instruction

   cout<<"Enter T/t for True; F/f for False\n";

   //This initializes the question

   string questions[5] = { "Q1", "Q2", "Q3", "Q4", "Q5"};

   //This initializes the correct options

   char options[5] = { 'T','T','F','F','T'};

   //This declares the user response

   char opt;

   //This initializes the score to 0

   int score = 0;

   //This loop is repeated 5 times

   for (int i = 0; i < 5; i++){

       //This prints the current question

       cout << i + 1 <<". "<<questions[i]<<"\nAnswer: ";

       //This gets the user response

       cin>>opt;

       //If the user response is correct

       if(toupper(opt) == options[i]){

           //The score is incremented by 2

           score+=2;

       }

   }

   //This prints the total score

   cout<<"Score: "<<score;

   return 0;

}

Read more about loops at:

brainly.com/question/19347842

7 0
2 years ago
Other questions:
  • Which of the following option is correct about HCatalog?
    14·1 answer
  • You bought a monochrome laser printer two years ago. The printer has gradually stopped feeding paper. Which printer component sh
    14·1 answer
  • As a bank employee, you often work from home and remotely access a file server on the bank’s network to correct errors in financ
    8·1 answer
  • A program that contains the following method: public static void display(int arg1, double arg2, char arg3) { System.out.println(
    15·1 answer
  • To reduce costs and the environmental impact of commuting, your company decides to close a number of offices and to provide supp
    14·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • Why can it be helpful to perform mathematical calculations using programming? Choose the best answer.
    11·1 answer
  • Temperature converter. This program should prompt the user for two arguments, first a decimal number and second, a single letter
    10·1 answer
  • Three healthcare firms jointly own and share the same cloud resources to meet their computing needs. Which cloud model does this
    15·1 answer
  • ______________________ can run on a workstation or server and is at the heart of all business applications.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!