java basic

    030 - Further For Loop Practice 6 (reverse string)

    030 - Further For Loop Practice 6 (reverse string)

    Given the following inputs: String s; Write a for loop that will print out the reverse of the string. Sample input/outputs: In: manhattan out: nattahnam In: processor out: rossecorp In: racecar out: racecar Solution 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; class Bakjoon { public static void main(String[] args) { Scanner inp = new Scanner(System.in); System.out.print("In:"); Str..

    029 - Further For Loop Practice 5 (printing characters)

    029 - Further For Loop Practice 5 (printing characters)

    Given the following inputs: String s; Write a for loop that will print out each letter of the string s, separated by spaces, on the same line. Sample input/outputs: In: hello out: h e l l o In: covert out: c o v e r t In: blasphemy out: b l a s p h e m y Solution 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; class Bakjoon { public static void main(String[] args) { Scanner inp = new ..

    028 - Further For Loop Practice 4 (repeating X times)

    028 - Further For Loop Practice 4 (repeating X times)

    Given the following inputs: int x; Write a for loop that will print out "AP CS A" x number of times, new line per print. Sample input/outputs: In: 3 AP CS A AP CS A AP CS A In: 5 AP CS A AP CS A AP CS A AP CS A AP CS A In: 1 AP CS A Solution 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; class Bakjoon { public static void main(String[] args) { Scanner inp = new Scanner(System.in); Sy..

    027 - Further For Loop Practice 3 (descending)

    027 - Further For Loop Practice 3 (descending)

    Given the following inputs: int x; Write a for loop that will print out a series of numbers starting at one less than x and ending at 0. Sample input/outputs: In: 7 out: 6 5 4 3 2 1 0 In: 12 out: 11 10 9 8 7 6 5 4 3 2 1 0 In: 20 out:19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Solution 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; class Main { public static void main(String[] a..