Answer:
[tex]78\frac{17}{20}[/tex]
Explanation:
There are 4 marble—red (R), blue (B), green (G), yellow (Y) — in a bag. We randomly draw marble without replacement from the bag. A) What i the probability that the firt drawing i red and the econd
drawing i yellow?
1/12
but why?
the first time you have a 1/4 chance, and the second time you have a 1/3 chance. since this is an AND event, we will multiply them together and get 1/12
I'm not sure why there's runtime errors in my code
Object temp = thePile.elementAt(i);
thePile.setElementAt(thePile.elementAt(j), i);
thePile.setElementAt(temp, j);
public Solitaire() {
window = new SolitaireFrame();
initialize();
window.show();
}
public void addCard(Card aCard) {
thePile.push(aCard);
}
private Stack thePile;
public class Main {
public static void main(String[] args) {
new Solitaire();
}
}
Answer: Object temp = thePile.element At(i); th Pile.setElementAt(thePile.elementAt(j), i); thePile.setElementAt(temp, j); public Solitaire() { window = new SolitaireFrame(); initialize(); window.show(); } public void addCard(Card aCard) { thePile.push(aCard); } private Stack thePile; public class Main { public static void main(String[] args) { new Solitaire(); } }
Explanation:
Based on the code given , it appears that there are no syntax errors. However, there are a few issues that might cause runtime errors:
The class "SolitaireFrame" might not be defined or imported properly.The class "Card" might not be defined or imported properly.The method "initialize()" might not be defined or implemented correctly.The class "Stack" might not be defined or imported properly.The variable "thePile" might not be initialized before use.The elements at i and j in the swap method might not be within the bounds of the stack.What is the runtime errors?The code creates an instance of a class called "Solitaire" and calls its constructor, which in turn initializes the window and calls the "initialize()" method. It then calls the "addCard()" method to add a card to a stack called "thePile".
Therefore, It also contains a swap method which is used to swap elements in a stack. The error message "runtime errors in the code" is not specific enough to determine the cause of the problem.
Learn more about runtime errors from
https://brainly.com/question/14727652
#SPJ1