From 9c3ec5e66fa575a91ca19377b62b1ba3d542ad9d Mon Sep 17 00:00:00 2001 From: amaanweb <42690004+amaanweb@users.noreply.github.com> Date: Sat, 5 Sep 2020 15:37:18 +0530 Subject: [PATCH 1/4] created iamanullahmahmood@gmail.com.cpp --- .../iamanullahmahmood@gmail.com.cpp | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Assignment-1-STL/iamanullahmahmood@gmail.com.cpp diff --git a/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp b/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp new file mode 100644 index 0000000..8ba4225 --- /dev/null +++ b/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp @@ -0,0 +1,93 @@ +// iamanullahmahmood@gmail.com + +/* + Program Name: Typing Speed Calculator + Author: Amanullah Mahmood + Date: Sat, 5 September 2020 +*/ + +#include +#include +#include +#include +#include + +using namespace std; + +int main() { + + string lines[1396]; + int totalCharactersTyped = 0; + time_t totalTypingTime = 0; + + // Read from the text file if exists. + ifstream sampleTextFile("shakespeare.txt"); + if(!sampleTextFile) + { + cout<<"Couldn't open the file"<::max(),'\n'); + + // Showing random sentences to a user + // Reading user input + // Calculating time and character + for (int i = 0; i < 5; i++) + { + srand(time(0)); + int line = rand() % 1396; + cout<((static_cast(totalCharactersTyped)/totalTypingTime)*60) << " characters/min.\n"; + cout << "=====================================================\n"; + + // Close the file + sampleTextFile.close(); +} + +/* +CREDIT +LINE 23 - Reading from text: +https://stackoverflow.com/questions/11546177/how-to-read-lines-of-text-from-file-and-put-them-into-an-array +LINE 43 - Skip Enter: +https://stackoverflow.com/questions/903221/press-enter-to-continue +LINE 51 - Generating Random Number +http://www.cplusplus.com/reference/cstdlib/rand/ +LINE 55 - Calculating Time +https://github.com/regstrtn/cool-codes/blob/master/measure-time-cpp.cpp +LINE 57 - Reading from console +https://stackoverflow.com/questions/18786575/using-getline-in-c +*/ + +/* +ASSUMPTION +User will write sentences without any error. +*/ \ No newline at end of file From 4b2005608886a5bedd23924a2bdba0a41864db90 Mon Sep 17 00:00:00 2001 From: amaanweb <42690004+amaanweb@users.noreply.github.com> Date: Sat, 5 Sep 2020 15:38:19 +0530 Subject: [PATCH 2/4] Delete iamanullahmahmood@gmail.com.cpp --- .../iamanullahmahmood@gmail.com.cpp | 93 ------------------- 1 file changed, 93 deletions(-) delete mode 100644 Assignment-1-STL/iamanullahmahmood@gmail.com.cpp diff --git a/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp b/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp deleted file mode 100644 index 8ba4225..0000000 --- a/Assignment-1-STL/iamanullahmahmood@gmail.com.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// iamanullahmahmood@gmail.com - -/* - Program Name: Typing Speed Calculator - Author: Amanullah Mahmood - Date: Sat, 5 September 2020 -*/ - -#include -#include -#include -#include -#include - -using namespace std; - -int main() { - - string lines[1396]; - int totalCharactersTyped = 0; - time_t totalTypingTime = 0; - - // Read from the text file if exists. - ifstream sampleTextFile("shakespeare.txt"); - if(!sampleTextFile) - { - cout<<"Couldn't open the file"<::max(),'\n'); - - // Showing random sentences to a user - // Reading user input - // Calculating time and character - for (int i = 0; i < 5; i++) - { - srand(time(0)); - int line = rand() % 1396; - cout<((static_cast(totalCharactersTyped)/totalTypingTime)*60) << " characters/min.\n"; - cout << "=====================================================\n"; - - // Close the file - sampleTextFile.close(); -} - -/* -CREDIT -LINE 23 - Reading from text: -https://stackoverflow.com/questions/11546177/how-to-read-lines-of-text-from-file-and-put-them-into-an-array -LINE 43 - Skip Enter: -https://stackoverflow.com/questions/903221/press-enter-to-continue -LINE 51 - Generating Random Number -http://www.cplusplus.com/reference/cstdlib/rand/ -LINE 55 - Calculating Time -https://github.com/regstrtn/cool-codes/blob/master/measure-time-cpp.cpp -LINE 57 - Reading from console -https://stackoverflow.com/questions/18786575/using-getline-in-c -*/ - -/* -ASSUMPTION -User will write sentences without any error. -*/ \ No newline at end of file From 53145649cc9b9e63b6713b902897be56926510e5 Mon Sep 17 00:00:00 2001 From: amaanweb <42690004+amaanweb@users.noreply.github.com> Date: Sat, 5 Sep 2020 15:39:17 +0530 Subject: [PATCH 3/4] submitted Screening Assignement --- .../iamanullahmahmood@gmail.com.cpp | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Screening-Assignment/iamanullahmahmood@gmail.com.cpp diff --git a/Screening-Assignment/iamanullahmahmood@gmail.com.cpp b/Screening-Assignment/iamanullahmahmood@gmail.com.cpp new file mode 100644 index 0000000..8ba4225 --- /dev/null +++ b/Screening-Assignment/iamanullahmahmood@gmail.com.cpp @@ -0,0 +1,93 @@ +// iamanullahmahmood@gmail.com + +/* + Program Name: Typing Speed Calculator + Author: Amanullah Mahmood + Date: Sat, 5 September 2020 +*/ + +#include +#include +#include +#include +#include + +using namespace std; + +int main() { + + string lines[1396]; + int totalCharactersTyped = 0; + time_t totalTypingTime = 0; + + // Read from the text file if exists. + ifstream sampleTextFile("shakespeare.txt"); + if(!sampleTextFile) + { + cout<<"Couldn't open the file"<::max(),'\n'); + + // Showing random sentences to a user + // Reading user input + // Calculating time and character + for (int i = 0; i < 5; i++) + { + srand(time(0)); + int line = rand() % 1396; + cout<((static_cast(totalCharactersTyped)/totalTypingTime)*60) << " characters/min.\n"; + cout << "=====================================================\n"; + + // Close the file + sampleTextFile.close(); +} + +/* +CREDIT +LINE 23 - Reading from text: +https://stackoverflow.com/questions/11546177/how-to-read-lines-of-text-from-file-and-put-them-into-an-array +LINE 43 - Skip Enter: +https://stackoverflow.com/questions/903221/press-enter-to-continue +LINE 51 - Generating Random Number +http://www.cplusplus.com/reference/cstdlib/rand/ +LINE 55 - Calculating Time +https://github.com/regstrtn/cool-codes/blob/master/measure-time-cpp.cpp +LINE 57 - Reading from console +https://stackoverflow.com/questions/18786575/using-getline-in-c +*/ + +/* +ASSUMPTION +User will write sentences without any error. +*/ \ No newline at end of file From 1967e996addf0193e79576782c1becf5d4825a8b Mon Sep 17 00:00:00 2001 From: amaanweb <42690004+amaanweb@users.noreply.github.com> Date: Sat, 5 Sep 2020 17:41:19 +0530 Subject: [PATCH 4/4] Rename iamanullahmahmood@gmail.com.cpp to iamanullahmahmood.cpp --- .../{iamanullahmahmood@gmail.com.cpp => iamanullahmahmood.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Screening-Assignment/{iamanullahmahmood@gmail.com.cpp => iamanullahmahmood.cpp} (99%) diff --git a/Screening-Assignment/iamanullahmahmood@gmail.com.cpp b/Screening-Assignment/iamanullahmahmood.cpp similarity index 99% rename from Screening-Assignment/iamanullahmahmood@gmail.com.cpp rename to Screening-Assignment/iamanullahmahmood.cpp index 8ba4225..eb157ad 100644 --- a/Screening-Assignment/iamanullahmahmood@gmail.com.cpp +++ b/Screening-Assignment/iamanullahmahmood.cpp @@ -90,4 +90,4 @@ LINE 57 - Reading from console /* ASSUMPTION User will write sentences without any error. -*/ \ No newline at end of file +*/