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
Question #4
Igoryamba

Answer:

The y-intercept is going to fall by -2 but the x-intercept will run +5

Explanation:

Becuase the derivative of the equation causes this when plugged into the formula

6 0
3 years ago
Which one Bc I’m struggling
amid [387]
14 is c and 16 a btw do you go to connection academy
6 0
3 years ago
Read 2 more answers
Hi guys
Anastaziya [24]
Vectors and arrays are 0-based, so they don't start at 1 but at 0

your sort works by switching positions of 2 elements, which in your case didn't happen for the pair of the first&second element
your outer-loop starts with k=1, which should be k=0 instead
6 0
3 years ago
What types of activities are ideal for a robot to perform?
LUCKY_DIMON [66]

The type of activities that are ideal for a robot to perform are; Repetitive tasks

Robots are machines that are programmable by a computer which have the capacity of automatically carrying out a complex series of actions.

Now, robots are used in a wide array of industries which include manufacturing, assembly and packaging, transport, earth and space exploration, e.t.c.

The most common use are found primarily in the automobile industry where they are used to carry out repetitive tasks and those that are difficult or hazardous for humans.

Read more about robots at; brainly.com/question/9145476

3 0
3 years ago
In ipv4, datagram fragment might be fragmented again at the next router. re-assembly of these sub-fragments is handled by?
s2008m [1.1K]

In IPv4, the following router could fragment the datagram fragment once more. This sub-fragment reassembling is done by the first router.

<h3>What is ipv4?</h3>
  • The fourth iteration of the Internet Protocol is known as IPv4.
  • The Internet and other packet-switched networks use it as one of its primary core protocols for internetworking.
  • The first production-ready release of IPv4 was made available on the SATNET in 1982 and the ARPANET in January 1983.
  • A protocol for usage on packet-switched Link Layer networks is the Internet Protocol version 4 (IPv4) (e.g. Ethernet).
  • A capacity of roughly 4.3 billion addresses is offered by IPv4.

To learn more about ipv4, refer to:

brainly.com/question/28432421

#SPJ4

5 0
2 years ago
Other questions:
  • Which data type uses more memory an integer or an unsigned integer?
    6·1 answer
  • Which constraints is applied to a group of fillets that are created by specifying the same radius?
    6·2 answers
  • Which of the following is a typical concern for developers while using prototypes?
    6·2 answers
  • Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whet
    10·1 answer
  • A quality assurance test for digital imaging receptors is to check for dark noise. What is the purpose of this test?
    8·1 answer
  • Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series
    9·1 answer
  • Raman will perform in pune tomorrow(simple past)​
    11·2 answers
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • With which type of satellite is there a propagation delay?
    5·1 answer
  • Electronic hacking and illegal trespassing for the purposes of acquiring a competitor’s proprietary information is considered.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!