<\/span><\/h2>\n\n\n\nImplement a simple calculator that performs the following operations on binary numbers<\/em>: addition, subtraction, multiplication, and division. Note that division operation must be integer division<\/em> only; for example, 1001 \/ 100 = 10<\/strong>, 1110\/101 = 10<\/strong>, and 101\/1 = 101<\/strong>.<\/p>\n\n\n\n- Styling.<\/em> The document’s elements must have the following styles:
body<\/code> has a width<\/code> of 33%<\/code>.<\/li>res<\/code> has a background-color<\/code> of lightgray<\/code>, a border<\/code> that is solid<\/code>, a height<\/code> of 48px<\/code>, and a font-size<\/code> of 20px<\/code>.<\/li>btn0<\/code> and btn1<\/code> have a background-color<\/code> of lightgreen<\/code> and a color<\/code> of brown<\/code>.<\/li>btnClr<\/code> and btnEql<\/code> have a background-color<\/code> of darkgreen<\/code> and a color<\/code> of white<\/code>.<\/li>btnSum<\/code>, btnSub<\/code>, btnMul<\/code>, and btnDiv<\/code> have a background-color<\/code> of black<\/code>, a color<\/code> of red<\/code>.<\/li>- All the buttons in
btns<\/code> have a width<\/code> of 25%<\/code>, a height<\/code> of 36px<\/code>, a font-size<\/code> of 18px<\/code>, margin<\/code> of 0px<\/code>, and float<\/code> value left<\/code>.<\/li><\/ul><\/li><\/ul>\n\n\n\nThe .js<\/code> and .css<\/code> files are in different directories, so use the link<\/em> tag to provide the CSS file path and the script<\/em> tag to provide the JS file path:<\/p>\n\n\n\n<!DOCTYPE html>\n<html>\n <head>\n <link rel=\"stylesheet\" href=\"css\/binaryCalculator.css\" type=\"text\/css\">\n <\/head>\n \n <body>\n \t<script src=\"js\/binaryCalculator.js\" type=\"text\/javascript\"><\/script>\n <\/body>\n<\/html><\/pre>\n\n\n\n<\/span>Constraints<\/strong><\/span><\/h2>\n\n\n\n- All expressions in the test dataset are entered in the form operand = operator = operand2<\/strong>, where operand1<\/em><\/strong> is the first binary number, operand2<\/em><\/strong> is the second binary number, and operator<\/em><\/strong> is in the set .<\/li>
- Both operands will always be positive integers when converted from base-2<\/strong> to base-10<\/strong>.<\/li>
- All expressions will be valid.<\/li><\/ul>\n\n\n\n
<\/span>Solution – Day 9: Binary Calculator<\/strong><\/span><\/h2>\n\n\n\nbinaryCalculator.css<\/strong><\/p>\n\n\n\n body\n{\n width: 33%;\n}\n#btn0,#btn1\n{\n background-color: lightgreen;\n color: brown;\n}\n\n#btnClr,#btnEql\n{\n background-color: darkgreen;\n color: white;\n}\n\n#btnSum,#btnSub,#btnMul,#btnDiv\n{\nbackground-color: black;\ncolor: red;\n}\n\nbutton\n{\n width :25%;\n height :36px;\n font-size :18px; \n margin :0px;\n float :left\n}\n\n#res {\n background-color: lightgray;\n border: solid;\n height: 48px;\n font-size: 20px;\n}<\/pre>\n\n\n\n