Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- uses: actions/checkout@v2
- uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "nameless-forest-60668"
heroku_email: "robert@develogical.com"
heroku_api_key: ${{secrets.TEJASFIRSTAPP}}
heroku_app_name: "tejas-firstapp-2323"
heroku_email: "tvenkate@andrew.cmu.edu"
40 changes: 40 additions & 0 deletions src/main/java/com/develogical/QueryProcessor.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.develogical;

import java.util.Arrays;

public class QueryProcessor {

public String process(String query) {
Expand All @@ -8,6 +10,44 @@ public String process(String query) {
"English poet, playwright, and actor, widely regarded as the greatest " +
"writer in the English language and the world's pre-eminent dramatist.";
}
if (query.toLowerCase().contains("large")){

query.replaceAll("%20", "");
query.replaceAll("[^0-9]+", " ");
List<Int> x = Arrays.asList(query.trim().split(" "));

return x.max();
}

if (query.toLowerCase().contains("plus")){

query.replaceAll("%20", "");
query.replaceAll("[^0-9]+", " ");
List<Int> x = Arrays.asList(query.trim().split(" "));

int sum = 0;
for(int i = 0; i < x.size(); i++){
sum += x.get(i);
}

return sum;
}


if (query.toLowerCase().contains("multip")){

query.replaceAll("%20", "");
query.replaceAll("[^0-9]+", " ");
List<Int> x = Arrays.asList(query.trim().split(" "));

int sum = 1;
for(int i = 0; i < x.size(); i++){
sum = sum * x.get(i);
}

return sum;
}

return "";
}
}
1 change: 1 addition & 0 deletions src/main/java/com/develogical/web/IndexPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ protected void writeContentTo(PrintWriter writer) {
"<form><input type=\"text\" name=\"q\" />" +
"<input type=\"submit\">" +
"</form>" +
"<h2>Thank You!!</h2>" +
"</p>");
}

Expand Down