subject
Engineering, 16.01.2021 01:20 juliahbaratt2717

Write a Java program that allows entering, one by one, 8 integers with binary signification i. e 0 or 1, and calculating the decimal number that is equivalent to this binary series. Note that to convert a number in binary representation into decimal representation, you must proceed as follows :
For example : a number with 4 binary digits : 1 1 0 1 will be converted to decimal representation by taking digits from right to left : 1x20 +0x21 +1x22 +1x23 =13.
Example of execution :
Enter a binary digit: 1
Enter a binary digit: 0 Enter a binary digit: 0 Enter a binary digit: 1 Enter a binary digit: 0 Enter a binary digit: 1 Enter a binary digit: 0 Enter a binary digit: 1
The decimal number is : 169.
The entry of each digit must be validated. If the digit is not 0 or 1, we retake the entry of that digit till we obtain 8 binary digits.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:20
For each of the following process: a) sketch the p-v diagram, b)sketch t-s diagram, c) sketch t-v diagram, d) sketch the boundary work on one of the diagrams (a, b or c) and e) sketch the reversible heat transfer on one of the diagrams (a, b or c): 1- isobaric process from compressed liquid to superheated vapor 2- isothermal process from compressed liquid to superheated vapor 3- isentropic process from compressed liquid to superheated vapor
Answers: 3
question
Engineering, 04.07.2019 19:10
What is the main objective of using reheat rankine cycle?
Answers: 3
question
Engineering, 04.07.2019 19:10
An electric kettle is made out of stainless steel, weighs two pounds (when empty) and is equipped with a heating element that consumes 2 kw of electricity. assuming that the water and the kettle are at the same uniform temperature at any moment of time, calculate the shortest possible time to bring 2 quarts of water from room temperature to the onset of boiling
Answers: 2
You know the right answer?
Write a Java program that allows entering, one by one, 8 integers with binary signification i. e 0 o...
Questions
question
Mathematics, 17.04.2020 21:12
question
Mathematics, 17.04.2020 21:12
question
Mathematics, 17.04.2020 21:12
question
Physics, 17.04.2020 21:13
question
Mathematics, 17.04.2020 21:13
Questions on the website: 13722367