-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wrote 4 new tests - seggregated I/O of test programs - partially fixes #2
- Loading branch information
Showing
25 changed files
with
264 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"""Import Run() for initializing program data""" | ||
from coderunner.coderunner import Run | ||
from coderunner.coderunner import code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
from coderunner import coderunner | ||
import pprint | ||
|
||
program_name = "testfiles/" + "test_python.py" | ||
source_code = "testfiles/" + "test_python_input.py" | ||
language = "Python" | ||
output = "testfiles/" + "output2.txt" | ||
Input = "testfiles/" + "input.txt" | ||
r = coderunner.Run(program_name, language, output, Input) | ||
output = "testfiles/output/" + "output2.txt" | ||
Input = "testfiles/input/" + "input.txt" | ||
r = coderunner.code(source_code, language, output, Input) | ||
|
||
# run the code | ||
r.run() | ||
|
||
# get Submission status | ||
print("Status : " + r.getStatus()) | ||
if r.getError() != None: | ||
pprint.pprint("Error : " + r.getError()) | ||
|
||
r.run() | ||
|
||
# get Submission status | ||
print("Status : " + r.getStatus) | ||
|
||
# check if any error occured | ||
if r.getError() is not None: | ||
pprint.pprint("Error : " + r.getError()) | ||
else: | ||
print("Standard Output : ") | ||
pprint.pprint(r.getOutput()) | ||
print("Standard Output : ") | ||
pprint.pprint(r.getOutput()) | ||
print("Execution Time : " + r.getTime()) | ||
print("Memory : " + str(r.getMemory())) | ||
print("Memory : " + str(r.getMemory())) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
232 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Shruti | ||
50000 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The number is a palindrome! |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Not eligible for loan! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello, World! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 11 2 3 5 8 13 21 34 55 89 144 233 377 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Factorial = 362880 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
int main(){ | ||
int n, num, digit, rev = 0; | ||
cin >> num; | ||
n = num; | ||
do | ||
{ | ||
digit = num % 10; | ||
rev = (rev * 10) + digit; | ||
num = num / 10; | ||
} while (num != 0); | ||
cout << "The reverse of the number is: " << rev << endl; | ||
if (n == rev) | ||
cout << "The number is a palindrome."; | ||
else | ||
cout << "The number is not a palindrome."; | ||
return 0; | ||
// calculate factorial of a number | ||
long Fact(long); | ||
|
||
int main () { | ||
long x = 9, fact; | ||
fact = Fact (x); | ||
cout << "Factorial = " << fact; | ||
|
||
return 0; | ||
} | ||
|
||
long Fact (long a) { | ||
if (a == 0) return 1; | ||
else return a * Fact (a - 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
using namespace std; | ||
int main(){ | ||
int n, num, digit, rev = 0; | ||
cin >> num; | ||
n = num; | ||
do | ||
{ | ||
digit = num % 10; | ||
rev = (rev * 10) + digit; | ||
num = num / 10; | ||
} while (num != 0); | ||
cout << "The reverse of the number is: " << rev << endl; | ||
if (n == rev) | ||
cout << "The number is a palindrome."; | ||
else | ||
cout << "The number is not a palindrome."; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#include<stdio.h> | ||
|
||
int main(){ | ||
int a, b, c; | ||
|
||
scanf("%d%d", &a, &b); | ||
|
||
c = a + b; | ||
|
||
printf("Sum of the numbers = %d\n", c); | ||
|
||
return 0; | ||
} | ||
int F1 = 0, F2 = 1, F3, n = 15; | ||
if(n == 2) printf ("%d %d ", F1, F2); | ||
else{ | ||
printf("%d %d", F1, F2); | ||
do{ | ||
F3 = F1 + F2; | ||
printf("%d ", F3); | ||
F1 = F2; | ||
F2 = F3; | ||
n--; | ||
}while(n > 2); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include<stdio.h> | ||
|
||
int main(){ | ||
int a, b, c; | ||
|
||
scanf("%d%d", &a, &b); | ||
|
||
c = a + b; | ||
|
||
printf("Sum of the numbers = %d\n", c); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import java.util.Scanner; | ||
class Loan extends Exception { | ||
String name; | ||
double salary; | ||
void getInfo () { | ||
Scanner input = new Scanner (System.in); | ||
name = input.nextLine (); | ||
salary = input.nextDouble (); | ||
} | ||
void checkEligibility () throws Loan { | ||
if (salary < 70000) throw new Loan (); | ||
else System.out.println (name + " is eligible for loan!"); | ||
} | ||
public String toString () { | ||
return "Not eligible for loan!"; | ||
} | ||
} | ||
class Main { | ||
public static void main(String[] args) { | ||
Loan person = new Loan (); | ||
person.getInfo (); | ||
try { | ||
person.checkEligibility (); | ||
} | ||
catch (Loan l) { | ||
System.out.println (l); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
name = str(input()) | ||
print("Hello, " + name) | ||
print("Hello, World!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
n = int(input()) | ||
temp = n | ||
rev = 0 | ||
while(n > 0): | ||
dig = n % 10 | ||
rev = rev * 10 + dig | ||
n = n // 10 | ||
if(temp == rev): | ||
print("The number is a palindrome!") | ||
else: | ||
print("The number isn't a palindrome!") |
Oops, something went wrong.