Closed abhirupbanerjee97 closed 5 years ago
It works although the auto-grader takes a lot of time. Sorry for creating the issue.
abhirup bro i cannot solve this
this is driving me crazy...
anything on this please?
anything on this please?
did u get it solved i also need help on this
anything on this please? bro got answer u must update three files i.e Gate.java,FillTheCorral.java,HerdMaager.java and do rember to intialize HERD in HerdMaager.java it also created alot problem
Getting the issue of Compile Error: Error 37 on submitting the zip file by adding the file FillTheCorral.java, Gate.java and HerdManager.java in that zip archive. On uploading the zip file available in this repository the auto-grader is taking an extremely long time to grade it and hence no result is coming. This is regarding the Building your own Classes pt 2 - Auto Graded programming assignment of week 3.
Umm,just zip the main files(gate,fillthecoral,her manager) ,the autorgrade will do accept it
Getting the issue of Compile Error: Error 37 on submitting the zip file by adding the file FillTheCorral.java, Gate.java and HerdManager.java in that zip archive. On uploading the zip file available in this repository the auto-grader is taking an extremely long time to grade it and hence no result is coming. This is regarding the Building your own Classes pt 2 - Auto Graded programming assignment of week 3.
Umm,just zip the main files(gate,fillthecoral,her manager) ,the autorgrade will do accept it
Getting the issue of Compile Error: Error 37 on submitting the zip file by adding the file FillTheCorral.java, Gate.java and HerdManager.java in that zip archive. On uploading the zip file available in this repository the auto-grader is taking an extremely long time to grade it and hence no result is coming. This is regarding the Building your own Classes pt 2 - Auto Graded programming assignment of week 3.
Umm,just zip the main files(gate,fillthecoral,her manager) ,the autorgrade will do accept it
Yes,Thankyou! :)
please anyone explain or solve the same issue
@ADITIJ700 @abhirupbanerjee97 @KKhosla88 please help ?
@ADITIJ700 @abhirupbanerjee97 @KKhosla88 please help ?
Hey @RahulChoudhary9910 , I think something is missing in your Gate class. Here is my output so you can cross-check :) Gate.txt
Couldn't upload it in .java form,but it contains all the required class and paramteres.
thank you for reply,
i attached 3 files gate fillthecorral herdmanager please check once
and total these files only right zipped and than have to upload ?
On Fri, Jun 5, 2020 at 9:36 PM Aditi Khedkar notifications@github.com wrote:
@ADITIJ700 https://github.com/ADITIJ700 @abhirupbanerjee97 https://github.com/abhirupbanerjee97 @KKhosla88 https://github.com/KKhosla88 please help ?
Hey @RahulChoudhary9910 https://github.com/RahulChoudhary9910 , I think something is missing in your Gate class. Here is my output so you can cross-check :) Gate.txt https://github.com/TheAlgo/Coursera-Java-for-Android/files/4737255/Gate.txt
Couldn't upload it in .java form,but it contains all the required class and paramteres.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgo/Coursera-Java-for-Android/issues/1#issuecomment-639598558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYLVKKYTS5DXOWZY72OXZLRVEJX5ANCNFSM4HDMRNIQ .
please see attached files now attached txt files
please see and tell how to upload
On Fri, Jun 5, 2020 at 9:36 PM Aditi Khedkar notifications@github.com wrote:
@ADITIJ700 https://github.com/ADITIJ700 @abhirupbanerjee97 https://github.com/abhirupbanerjee97 @KKhosla88 https://github.com/KKhosla88 please help ?
Hey @RahulChoudhary9910 https://github.com/RahulChoudhary9910 , I think something is missing in your Gate class. Here is my output so you can cross-check :) Gate.txt https://github.com/TheAlgo/Coursera-Java-for-Android/files/4737255/Gate.txt
Couldn't upload it in .java form,but it contains all the required class and paramteres.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgo/Coursera-Java-for-Android/issues/1#issuecomment-639598558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYLVKKYTS5DXOWZY72OXZLRVEJX5ANCNFSM4HDMRNIQ .
package mooc.vandy.java4android.gate.logic;
import java.util.Random;
import mooc.vandy.java4android.gate.ui.OutputInterface;
/**
You must fill in the missing logic below. */ public class FillTheCorral { /**
/**
public void setCorralGates(Gate[] gate,Random selectDirection) { mOut.println("Initial gate setup:"); for(int i=0;i<gate.length;i++){ gate[i].setSwing(selectDirection.nextInt(3)-1); mOut.println("Gate " + i + ": " + gate[i].toString() ); } }
public boolean anyCorralAvailable(Gate[] corral){ for(int i=0;i<corral.length;i++){ if(corral[i].getSwingDirection() == Gate.IN) return true; } return false; }
public int corralSnails(Gate[] corral,Random rand){ int pasture = 5; int attemptCount = 0; int randomNumber = 0; int randomGate = 0; do { randomGate = rand.nextInt(corral.length); randomNumber = rand.nextInt(pasture)+1; mOut.println(randomNumber + " are trying to move through corral " + randomGate); pasture-=corral[randomGate].thru(randomNumber); attemptCount++; } while(pasture > 0); mOut.println("It took "+attemptCount+" attempts to corral all of the snails."); return attemptCount; }
}
package mooc.vandy.java4android.gate.logic;
import java.util.Random;
import mooc.vandy.java4android.gate.ui.OutputInterface;
/**
You must fill in the missing logic below. */ public class HerdManager { private static final int HERD =0 ; /**
/**
/**
/**
/**
Constructor initializes the fields. */ public HerdManager(OutputInterface out, Gate westGate, Gate eastGate) { mOut = out;
mWestGate = westGate; mWestGate.open(Gate.IN);
mEastGate = eastGate; mEastGate.open(Gate.OUT); }
// TODO -- Fill your code in here public void simulateHerd(Random rand) { int pen = HERD; int pasture = 0; int randomNumber = 0; mOut.println("There are currently " + pen + " snails in the pen and " + pasture + " snails in the pasture"); for (int i = 0; i < MAX_ITERATIONS; i++) { int direction = 0; int count = 0; boolean bool; if (pen == 0) { randomNumber = rand.nextInt(pasture) + 1; count = mWestGate.thru(randomNumber); pen += count; } else if (pasture == 0) { randomNumber = rand.nextInt(pen) + 1; count = mEastGate.thru(randomNumber); pen += count; } else { bool = rand.nextBoolean(); if (bool) { randomNumber = rand.nextInt(pen) + 1; count = mEastGate.thru(randomNumber); pen += count; } else { randomNumber = rand.nextInt(pasture) + 1; count = mWestGate.thru(randomNumber); pen += count;
}
}
pasture = HERD - pen;
mOut.println("There are currently " + pen + " snails in the pen and " + pasture + " snails in the pasture");
}
} }
package mooc.vandy.java4android.gate.logic;
/**
This file defines the Gate class. */ public class Gate { public static final int IN = 1; public static final int OUT = -1; public static final int CLOSED = 0;
private int mSwing;
public Gate(){ mSwing = CLOSED; }
public boolean setSwing(int direction) { if(direction == IN || direction == OUT || direction == CLOSED) { mSwing = direction; return true; } return false; }
public boolean open(int direction) { if (direction == IN || direction == OUT) { this.setSwing(direction); return true; } return false; }
public void close() { mSwing = 0; }
public int getSwingDirection() { return mSwing; }
public int thru(int count) { if(mSwing == IN) return count; else if(mSwing == OUT) return - count; else return 0; }
@Override public String toString() { if(mSwing ==0) return "This gate is closed"; else if(mSwing == IN) return "This gate is open and swings to enter the pen only"; else if (mSwing == OUT) return "This gate is open and swings to exit the pen only"; else return "This gate has an invalid swing direction"; } }
@ADITIJ700
@ADITIJ700
Your files are correct,you just have to zip them and upload them now
@ADITIJ700 please
Zipped them in one folder named anything
And than upload that single zip file
Right?
@ADITIJ700 please
Zipped them in one folder named anything
And than upload that single zip file
Right?
yeah
Thank you very much for clarifying the doubt. I am trying it
On Fri, 5 Jun, 2020, 11:05 PM Aditi Khedkar, notifications@github.com wrote:
@ADITIJ700 https://github.com/ADITIJ700 please
Zipped them in one folder named anything
And than upload that single zip file
Right?
yeah
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgo/Coursera-Java-for-Android/issues/1#issuecomment-639655834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYLVKLCFWHTHZCJLML4IITRVEUGNANCNFSM4HDMRNIQ .
Thank you very much for clarifying the doubt. I am trying it … On Fri, 5 Jun, 2020, 11:05 PM Aditi Khedkar, @.***> wrote: @ADITIJ700 https://github.com/ADITIJ700 please Zipped them in one folder named anything And than upload that single zip file Right? yeah — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYLVKLCFWHTHZCJLML4IITRVEUGNANCNFSM4HDMRNIQ .
pleasure! :)
Getting the issue of Compile Error: Error 37 on submitting the zip file by adding the file FillTheCorral.java, Gate.java and HerdManager.java in that zip archive. On uploading the zip file available in this repository the auto-grader is taking an extremely long time to grade it and hence no result is coming. This is regarding the Building your own Classes pt 2 - Auto Graded programming assignment of week 3.