Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed #43 (Problems Fixed) #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This bit of added code takes care of the incorrect initialization of a variable
Eg: initialise a= 10
initialise a =10
initialise a = 10
would only create "float a" in the C code but after adding this bit of code you will get the C code as "float a=10" it will complete the initialisation
Also Character Initialisation has also been taken care of in this code. It enables you to initialise character by typing initialise char b= 'c' in sudocode and generates the C code of " char b='c' ". It can also print the character datatype using print b which will generate the C code printf("%c\n",b);
The issue with the print command has also been fixed: Supposing we have a variable called temp in the code and we want to print the word "Temp" and then print the data inside temp now there is feature enabling us to do just that. Now if we enclose temp in “(doublequotes)” it will only print the data in temp and not the variable temp .eg print “temp” will display the text temp and not the data inside variable temp.If the data in temp need to be printed it can be done by print temp. Also yet another similar issue resolved is that when we have two variables a and b in the program and we write in the pseudo-code print a+b instead of writing a+b in the program it writes the string "a+b" which makes it compulsory for us to create a temporary variable increasing both time and space complexity of the code. Both these issues can be sorted easily. Now that has been taken care of by putting the expression in round brackets (). eg print (a+b) will generate now the c code of printf("%f\n",a+b);. Now sample test files sudocode4 and sudocode5 have been added to the testfile folder to validate all the above corrected issues.