Comments on inline
documentation
- I
asked for date, section, and lab1 – you are missing one or more of these
- // Declare variables Simply
labeling declarations as such isn’t adequate – I can see that they are
declarations, I want to know what each variable is used for.
- //input is not an appropriate
comment when what you are really doing is prompting the user to
enter data
- //set
operands and operator – doesn’t describe getting the individual characters from
the input string and echoing them.
- //convert
values of hexadecimal numbers is not an adequate explanation of what you are
doing. Convert hexadecimal digits
into decimal numbers by subtracting off the ascii value of ‘a’ and adding
10 – otherwise ‘a’-‘a’ would be 0
and you want it to be 10.
- //calculation
with Check operator
– does not indicate that you are checking to make sure that the operator
is one of the two allowed values ‘+’ or ‘-‘.
- Program
Aborted: operand1 't'is not correct for operation '*'.
doesn’t
make sense as output explaining error.
- //separates char and echoes out values input
9.
//Next 5 lines take input from program actually does more than
that and should say so
10.
you
don’t have any explanation of what the variables are used for
11.
//Determines the value of operand 1, or if the operator is
correct This
part of your code does not do ANYTHING
with the operator
12.
// Decides if the digit is a char or interger this isn’t an accurate
comment. You are deciding if it’s in
range and converting it. Also spelling error
13.
// Declaration of keyboard – a totally useless comment
14.
// Instatiate keyboard – another useless comment – not spelled correctly
either.
15.
//object declarations useless comment
16.
//initializes the scanner object
useless
comment
Hexadecimal