Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Screening-Assignment/inayauzma828.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//inayauzma828@gmail.com

#include<bits/stdc++.h>
using namespace std;
int main(){
string arr[2000];
ifstream file("shakespeare.txt");
string str;
int counter = 0;
while(getline(file, str)){
arr[counter] = line; counter++;
}

srand(time(NULL));
for(int i=1;i<=5;i++){
cout << arr[rand() %10 + 1] << "\n";
}

string userInput;
cout << "type any sentence here: ";
time_t begin,end;
time(&begin);
getline(cin, userInput);
time(&end);
time_t duration = end-begin;

int string_size = userInput.size();

cout<< "Typing Speed: " << string_size/duration << "\n";
}