Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed #43 (Problems Fixed) #65

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

AviBomb
Copy link

@AviBomb AviBomb commented Dec 18, 2018

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.

@AviBomb
Copy link
Author

AviBomb commented Dec 18, 2018

Hey @rahulkumaran I have made the changes that were asked to be made in this one so have a look at this pr instead of the earlier one

@AviBomb AviBomb changed the title Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed #43 Variable intitialisation correction & Charecter Data type Initalisation & Print function Fixed #43 (Problems Fixed) Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant