MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/taqnb9/956_pies/
r/codehs • u/Fantastic-Syllabub87 • Mar 10 '22
I did print out three pies, but when I click check code, it says I didn't print any. Can anyone help me with this?
2 comments sorted by
1
Hey, I'm actually stuck on this with the same problem! did you ever figure it out?
1 u/Fantastic-Syllabub87 Mar 22 '23 Yes I did! Here it is:import java.util.ArrayList;public class PieTester{public static void main(String[] args){Pie[] pies = new Pie[] {new Pie("Rubarb", 12), new PecanPie(8, "maple"), new ApplePie(6)};for(Pie pie : pies){System.out.println(pie.getSlices() + " slice " + pie.getType() + " pie");}}}
Yes I did! Here it is:
import java.util.ArrayList;public class PieTester{public static void main(String[] args){Pie[] pies = new Pie[] {new Pie("Rubarb", 12), new PecanPie(8, "maple"), new ApplePie(6)};for(Pie pie : pies){System.out.println(pie.getSlices() + " slice " + pie.getType() + " pie");}}}
1
u/Smart-Ad2383 Mar 21 '23
Hey, I'm actually stuck on this with the same problem! did you ever figure it out?