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
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
question
Engineering, 04.07.2019 18:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
question
Engineering, 04.07.2019 18:20
The characteristic roots of a dynamic system are: 1.7920 1.8160 i, -1.7920 1.8160 i, -0.4160 what is the order of this system? what are the settling time and damping ratio of the system?
Answers: 3
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, 16.07.2021 19:50
question
Chemistry, 16.07.2021 20:00
question
Social Studies, 16.07.2021 20:00
question
Mathematics, 16.07.2021 20:00
question
Mathematics, 16.07.2021 20:00
question
Mathematics, 16.07.2021 20:00