代写program程序、代做c++,Python编程
Write a LMC program that can convert an n-bit binary number into a decimal number. Display the natural number as output before halting the program. The first input determines the value for n. It is assumed this value will be equal to four, or greater. For example, if the first input is eight (8) then eight subsequent inputs are requested. If the subsequent inputs number were 1, 0, 0, 1, 0, 0, 0, 0 then the output would be 9. n input values are provided by the user, one for each bit:
The first of these is the least-significant bit. The n’th input is the most-significant bit. Q1. Describe your approach to solving the problem. Use natural language, structured like a conventional programming language to communicateyour design. When necessary, use looping and conditional constructs. Name symbols sensibly to make their use clear. Q2. Draft a test plan to be used as a verification method to ensure that your LMC programiscorrect. Tabularise test input value(s) and the expected output(s)
Consider uncommon cases. For example, when the calculator reaches its maximumvalue, when negative values are calculated, or when an input is unexpectedly large. Draft your test plan using the following template (two examples are provided):
Comma-separate the input and output values. Delete the examples.
Input Value(s)
Expected output
value(s)
Notes
2,4,6 10 All even numbers
1,3,5 9 All odd numbers
Q3. Implement an LMC program according to the algorithm you designed in Q1. Use the test suite you designed in Q2 to verify the implementation of your algorithmis
correct. Only symbolic addressing is to be used; numerical addressing will be disabled. LMC program must request the correct number of input(s). LMC program must produce the correct number of output(s). LMC program must produce the correct output value(s) for all given test cases. Code must be tidy (spacing, indentation) and comments are to be used to describe the
algorithm. Do not describe the function of each LMC instruction. Your LMC file should show the full history of how your solution was implemented. Use LMC IDE v1.5.0.0 (or greater)
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
标签:
热点文章
烟草大王褚时健:创业别急躁 品质最重要
为何中国互联网公司不需要美国市场?
“内容时代”来临 内容驱动的商业模式无所不在
菜鸟创业者最容易犯下的11个大错
商业生态化时代来临,创业者该如何接招
你为啥打造不出一起创业的团队?
底层创业者生存报告:给你500万你会烧吗?
创业中宁做混蛋,也不要做老好人 CEO要敢于做坏人