Skip to content

Rejoicet/Assignment1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Assignment1

• Found how to open a file by reading from http://www.fredosaurus.com/notes-cpp/io/readtextfile.html and watching https://www.youtube.com/watch?v=nqFBVupEaKo • Found out how to calculate the length of string from http://www.cplusplus.com/reference/string/string/length/ • Found out about cmath from http://www.cplusplus.com/forum/beginner/107564/ • Got an idea on how to calculate occurrences of a specific character from https://www.youtube.com/watch?v=A3TPQH57i7U • Got an idea of the logic to be used to calculate bigrams by watching https://www.youtube.com/watch?v=L0KoF-8wZvg and reading https://stackoverflow.com/questions/11799956/performance-comparison-strstr-vs-stdstringfind and https://stackoverflow.com/questions/22315738/find-occurrences-of-all-substrings-in-a-given-string • If a DNA string in the file has a space in between, it considers the two as two separate strings • Say a DNA string goes like this – ATTCGA. The code will take 5 bigrams from it viz. AT, TT, TC, CG and GA. • Got to know about printing the output in a file after reading http://www.cplusplus.com/reference/cstdio/freopen/ , http://www.cplusplus.com/reference/cstdio/stdout/. • Got an idea on rand, srand and RAND_MAX by reading http://www.cplusplus.com/reference/cstdlib/rand/, http://www.cplusplus.com/reference/cstdlib/srand/ and http://www.cplusplus.com/reference/cstdlib/RAND_MAX/. • Took more inputs to generate random numbers from https://en.wikipedia.org/wiki/Box–Muller_transform, http://www.cplusplus.com/forum/beginner/26963/ and https://stackoverflow.com/questions/31089952/using-rand-rand-max-1 • Got an idea to print the same character multiple times from https://stackoverflow.com/questions/7897163/stdcout-to-print-character-n-times • Learnt about getline function from http://www.cplusplus.com/reference/string/string/getline/ • Got an idea how to go back to the beginning to the loop based on user input from https://www.youtube.com/watch?v=1XoBCmu57XQ • Found out how to change the chars to upper case from http://www.cplusplus.com/reference/cctype/toupper/ • Found out how to change the strings to upper case from https://stackoverflow.com/questions/23313498/c-convert-word-in-type-string-variable-to-lowercase • My idea initially for printing the 1000 strings was to dynamically create D1 to D1000 and then printing them as a separate function. I read about how to do it and also wrote down the logic and the method to do it. After that, before writing the code I discussed the logic I was using with one of my friends and he was speaking about printing the string as I was computing the length of each string itself. I verified that the logic would work by checking the probability of each string and finally it remains same at the end. Thus, I implemented the logic of printing each string as I compute the length of each.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages