Week1Mock1MCQ14

Run Settings
LanguageJava
Language Version
Run Command
public class Main { public static void main(String[] args) { // Harbor, Week 1, Mock 1, PR_PracticeTest_1.pdf // AP CS A // MCQ 14 String space = " "; String symbol = "*"; int num = 5; for (int i = 1; i <= num; i++) { System.out.print(symbol); } System.out.print("\n"); for (int i = 1; i <= num; i++) { for (int j = num - i; j > 0; j--) { System.out.print(space); } System.out.print(symbol); // The original code in the mock test // is missing the line below. // With the line of code below, // this code produces a "Z". System.out.print("\n"); } for (int i = 1; i <= num; i++) { System.out.print(symbol); } // Output: [Asterisks form the letter "Z".] } }
Editor Settings
Theme
Key bindings
Full width
Lines