11777 - Automate the Grades
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 - Automate the Grades Why getting WA???
Try running your code on the sample input. It looks like you mixed N and n.
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 9
- Joined: Sun Jul 21, 2013 2:34 pm
Re: 11777 - Automate the Grades Why getting WA???
Thanks Brian......Got Accepted
But while doing cin<<n; [wrong]....it also shows correct output !!!!!!!!!
But while doing cin<<n; [wrong]....it also shows correct output !!!!!!!!!
Re: 11777 - Automate the Grades Why getting WA???
Here's some input / output that was useful during testing / debugging.
Input:
AC Output:
Input:
Code: Select all
14
15 18 25 8 15 17 12
20 20 30 10 20 20 20
20 20 30 10 18 0 0
19 19 19 1 18 16 19
11 11 10 4 20 20 0
11 20 10 4 16 20 17
20 20 20 10 0 0 0
20 20 20 9 0 0 0
20 20 20 10 15 16 17
9 20 9 5 15 17 16
13 20 20 2 16 15 17
17 19 18 4 16 17 15
15 5 20 10 17 15 16
2 20 20 10 17 16 15
Code: Select all
Case 1: B
Case 2: A
Case 3: B
Case 4: C
Case 5: F
Case 6: D
Case 7: C
Case 8: D
Case 9: B
Case 10: F
Case 11: C
Case 12: C
Case 13: D
Case 14: D
11777 What's wrong with it ?!?
I've submitted this code for the problem 11777....and continuously getting WA!!
this is my code though it is simple....

this is my code though it is simple....

Code: Select all
while(Accepted)
return Happy;
Last edited by mpmohi on Sat Nov 22, 2014 10:51 pm, edited 1 time in total.
Re: 11777 - Automate the Grades Why getting WA???
It's getting a WA! though it passes the given debug test above..

Code: Select all
while(Accepted)
return Happy;
Last edited by mpmohi on Sat Nov 22, 2014 10:53 pm, edited 1 time in total.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 What's wrong with it ?!?
Input:AC output:
Code: Select all
1
20 20 30 10 0 10 10
Code: Select all
Case 1: A
Check input and AC output for thousands of problems on uDebug!
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 - Automate the Grades Why getting WA???
Don't double post.
Check input and AC output for thousands of problems on uDebug!
Re: 11777 - Automate the Grades Why getting WA???
Please refrain from repeating yourself.mpmohi wrote:It's getting a WA! though it passes the given debug test above..
Try the following input:
Code: Select all
1
20 20 30 10 1 15 15
Code: Select all
Case 1: A
Re: 11777 What's wrong with it ?!?
Yesss....accepted....thanks Binary bro.... 

Re: 11777 - Automate the Grades Why getting WA???
iam getting WA with c++
Code: Select all
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
char grade ;
int arry[10],n,avrage;
cin >>n;
for(int j=1;j<=n;j++){
int marks=0;
float sum=0;
int counter=0;
int avrage[3];
for (int i=0;i<7;i++)
{
cin >>arry[i];
if ( i >= 4 )
{
avrage [counter] = arry [i] ;
sort(avrage,avrage+counter);
counter++;
}
}
sum= (avrage[2]+avrage[1])/2.0;
marks =arry[0]+arry[1]+arry[2]+arry[3]+sum;
if (marks >= 90)
{
grade = 'A';
}
else if (marks >= 80 && marks < 90)
{
grade = 'B';
}
else if (marks >= 70 && marks < 80)
{
grade = 'C';
}
else if (marks >= 60 && marks < 70)
{
grade = 'D';
}
else
{
grade ='F';
}
cout << "Case " << j << ": " << grade <<endl;
}
}
Last edited by brianfry713 on Wed Jan 07, 2015 3:14 am, edited 1 time in total.
Reason: Added code blocks
Reason: Added code blocks
Re: 11777 - Automate the Grades Why getting WA???
Use code tags to share your code.mesho wrote:iam getting WA with c++
Return a 0 at the end of your program.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 - Automate the Grades Why getting WA???
Try solving it without using floating point.
Check input and AC output for thousands of problems on uDebug!
Re: 11777 - Automate the Grades Why getting WA???
Last edited by #bdbug66 on Sun Jun 15, 2014 6:53 pm, edited 1 time in total.
Re: 11777 - Automate the Grades Why getting WA???
Your code doesn't produce output that matches the sample output. You need to make sure your code does at least that - right?#bdbug66 wrote:getting WA. Can anyone HELP please?
Also, please take the time to read the thread carefully and test your code with the test cases you'll typically find. The thread exists (and people take the time to reply) for a reason.
Re: 11777 - Automate the Grades Why getting WA???
brianfry713 wrote:You're not printing the case number correctly if they get an F.
Strange school which doesn't have grade E, while has D and F.The letter grades are given based on the total marks obtained by a student and is shown below:
· A >= 90%
· B >= 80% & < 90%
· C >= 70% & < 80%
· D >= 60% & < 70%
· F < 60%

A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman