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 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
question
Engineering, 04.07.2019 19:10
What are the major differences between injection molding and extrusion?
Answers: 2
question
Engineering, 04.07.2019 19:10
Agas is compressed from vi 0.3 m, p 1 bar to of v2 0.1 m3, p2--3 bar. pressure and volume are related linearly during the process. for the gas, find the work, in kj.
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
English, 04.05.2021 23:20
question
Mathematics, 04.05.2021 23:20
question
Mathematics, 04.05.2021 23:20
question
Mathematics, 04.05.2021 23:20
Questions on the website: 13722363