hey guys my switch case is something like :
how would i write this in algorithm form?Code:case 'a': printf("Enter Name: \n"); break; case 'b': printf("Enter Tutorial time: \n"); break;
hey guys my switch case is something like :
how would i write this in algorithm form?Code:case 'a': printf("Enter Name: \n"); break; case 'b': printf("Enter Tutorial time: \n"); break;
What do you mean by "algorithm form"?
pseuodo code.
like writing the code but in english.
I don't think there's any formal definition of what pseudocode is meant to look like. So long as it explains what you're trying to do at that point in the program... fine, in my opinion.
I'd just remove the very C-style parts (e.g. printf) and would write something like:
Obviously if you have any clever fall-throughs in the switch statement then you should write the breaks in the pseudocode. But it should just be a basic description of what you want to do.Code:switch(blah) { case 'a': print "Enter Name: " case 'b': print "Enter Tutorial time: " }
This does not look like a pseudocode for me. I think you wanted a block scheme or something.
Code:If input is a lower-case 'a' letter ask user to enter his name, if it is a lower-case 'b' letter ask for tutorial time. Otherwise, do nothing.