hi chaps, I would like to do this exercise taken from the deitel and deitel book, chap 4 exercise 4.38, in brief: "Write an application that reads a 4 digit int and encrypt it replacing each digit with the result of addin 7 to it and getting the reminder after dividing the new value by 10. Then swap the first digit with the 3rd and swap the second with the fourt, then print the encrypted digit".
Now bearing in mind that I am only allowed to use a while statement (no for loops, no array, no switch and assuming the user enters numbers and not letters) becaue I haven't done them as yet, here's my pseudocode, and I would appreciate some feedback on it, if I am doing it right or wrong:
declare variables: digit, counter
input 1 digit
increment counter
print the inserted digit (just for testing purposes)
while counter > 0 and <=4
encrypt the digit
insert another number
print the inserted digit (just for testing purposes)
increment counter
Print each digit of the password
But I have a few questions:
1)The user will enter a digit one by one rather than a 4 digits int, is that ok?
2)I am thinking to have 2 files, one with a main method and another one with the class, variables and methods, but I wonder, when writing pseudocode, do you write it for both files? Take the example above, I don't say in there how the conversion is done, that a method will be called, so is it worth doing 2 separate pseudocode files or not? SOrry I am bit new to this so I am not entirely sure what's the best way to write pseudocode.
cheers