Question: Program Specification: Write a Java program that emulates a simple binary calculator: Declare and initialize a String variable ( bitString ) to Declare
Program Specification:
Write a Java program that emulates a simple binary calculator:
Declare and initialize a String variable bitString to
Declare and initialize an int variable resultSoFar to
Display the current expression to the screen
Repeat the following until the Exit option is selected:
Display a menu which gives the user the choice of the following menu options:
Shift Left, Add
Shift Left, Add
Exit, Evaluate
and uses a user validation loop to read their response into a String variable.
Note: You must repeatedly get the users response until it is exactly one of the characters
If Exit was NOT selected:
a Update the bitString string:
Add the selected operation string to the end of bitString : or
b Display the current bitstring to the screen
c Update the numeric result of the bitstring resultSoFar :
resultSoFar resultSoFar or resultSoFar resultSoFar
Display the entire expression with its result.
Grading:
tablePerformance Indicator,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
