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
zlopas [31]
3 years ago
11

1. Write a program that asks for 4 separate numbers that are binary (1 or 0). Create a variable called b0 for the first, b1 for

the second, b2 for the third, and b3 for the last. After gathering the four-input run the following calculation: 8b0 4b1 2b2 b3. Output the formula with the input values followed by the answer.
Computers and Technology
1 answer:
Snowcat [4.5K]3 years ago
8 0

Answer:

import java.util.Scanner;

public class CocaColaVendingTest {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter four sepertate binary numbers (1 or 0)");

       int b0 = in.nextInt();

       int b1 = in.nextInt();

       int b2 = in.nextInt();

       int b3 = in.nextInt();

       System.out.println("This formula \"8b0 4b1 2b2 b3\" is applied to get the following" +

               " "+(8*b0)+", "+(4*b1)+", "+(2*b2)+", "+(b3));

   }

}

Explanation:

This is implemented in java

Using the scanner class, the user is prompted to enter for values (0s or 1s)

These are received and stored in the variables b0, b1,b2,b3 as ints.

The formula  8b0 4b1 2b2 b3 is then applied within the output statement to display the results as required by the question

You might be interested in
Guess The Song: <br> What Popping Brand New Whip Just Hopped In, I Got options
Georgia [21]

Answer:

its called whats poppin lol

Explanation:

:)

7 0
3 years ago
________ is a method for addressing, creating, updating, or querying relational databases.
lorasvet [3.4K]
Structured Query Language<span> (</span>SQL<span>)</span>
4 0
4 years ago
Which term describes a secure, individual, private cloud-computing model hosted within a public cloud?
grin007 [14]

The term that describes a secure, individual, private cloud-computing model hosted within a public cloud is A hybrid cloud.

<h3>What is this cloud about?</h3>

A hybrid cloud is known to be a system or a model which is said to be a form of a private cloud that is linked with public cloud infrastructure, and it is one that tends to give room for an organization to act workloads in two environments.

Note that In this model, the public cloud is known to be one that is seen and it is one that becomes an extension of the private cloud to make a single, uniform cloud.

Hence, The term that describes a secure, individual, private cloud-computing model hosted within a public cloud is A hybrid cloud.

Learn more about hybrid cloud from

brainly.com/question/27838623

#SPJ1

7 0
2 years ago
Which role will grant a delegate read-only access to a particular workspace within a user’s Outlook mailbox?
DIA [1.3K]

Answer: i’m thinking it’s reviewer

Explanation:

4 0
3 years ago
Read 2 more answers
What is the practice of distributing responsibility among multiple people so that no one person has full control of
Sholpan [36]

Answer:

If the responsibilities are distributed ,the disputes amongst people wont take place because their wont be any partiality, everyone would be equal. Moreover it is difficult for one person to control everything at once and multiple people would help the work to be organized as everyone will have their own part of work which is supposed to be fulfilled.

8 0
3 years ago
Other questions:
  • The major difference between a calculator and a computer, when performing calculations, is that a
    14·2 answers
  • How can supply and demand for different careers affect job stability and income?
    6·1 answer
  • The file extensions .webm, .m4v, and .ogv are used for:
    15·1 answer
  • A sentinel value ________ and signals that there are no more values to be entered:____
    14·1 answer
  • Peter has a website that promotes his local vacation rental site. He uses Google Ads to manage his advertising campaign. He’s cr
    13·1 answer
  • The browser on which you are viewing web pages is called the
    13·1 answer
  • I NEED HELP ASAP!
    6·2 answers
  • What will be the range of the random numbers generated by the following code snippet? rand() % 50 + 5;
    14·1 answer
  • What is the output for this program?
    12·1 answer
  • Can a dod activity enter into a service contract for a military flight simulator without getting a waiver from the secretary of
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!