Question: Can this be walked through clearly with comments under each line of code. Not handwriting like was previously answered by Chegg. I cannot read this..
Can this be walked through clearly with comments under each line of code. Not handwriting like was previously answered by Chegg. I cannot read this.. Thank you.
Can someone walk through this step by step. Java
Thanks
Write a method that prints characters using the following header:
Public static void printChars(char ch1, char ch2, int numberPerLine)
This method prints the characters between ch1 and ch2 with the specified numbersPerLine. Write a test program that prints 10 characters per line from 1 to z. Characters are separated by exactly one space.
public class Exercise06_12 {
public static void main(String[] args) {
printChars('1', 'Z', 10);
}
public static void printChars(char ch1, char ch2, int numberPerLine) {
int count = 1;
for (int i = ch1; i
if (count % numberPerLine == 0)
System.out.println((char)i);
else
System.out.print((char)i + " ");
}
}
Expert Answer
-
Jannuu answered this Was this answer helpful?
0
1
374 answers



Given pologram as Public class Execese 06-12 public statk vold main(String() args) 9 Perme Chaos('s' z; 10); public static void paint Chars (chao cha charcha, Pnt numberper Line) a ant cant =s; tom cent e = chi ; qk=cha; it to count tt) if(cant% number pea Line ==0) system.out.println (Cchaoli); prints value an next line. else System.out. paint ((chas) it ""); Explanation: - Paent chars ( 1","z, 10); Paint chars (Chao cha, char cha, Pnt numberpes Line). so chl=1, cha=2 , numberperline = 10, ant cant=1 forcent i= cha; pa= cha; itt, cant++). texe chiis a characten variable. but it is so ,it stores Ascil value of character, assigned to integer i. Here chi= 1 Ascll -value ..9=49. cha=z Ascill-value is as 49 90. for (P=49) Pa=90; itt, cant ++). afcca d. 7 qf(count a number peoline ==0) 49 ?@ A B C D E F G H I J K L M N O P Y Z Q R S T U V W X 1 ** * * ****** * * * *** ** * * * * ** *** ** * * ** * * * * * * 3 Welcome to GDB Online, 4 GDB online is an online compiler and debugger tool for 5 C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, A 6 Code, Compile, Run and Debug online from anywhere in wa - ***** 9 public class Main 10 - { 11 public static void main(String[] args) 12. { 13 printChars('l', 'Z', 10); 14 } 15 public static void printChars(char chi, char ch2, int n 16 - { 17 int count = 1; 18 for (int i = ch1; i ?@ABCD E F G H I J K L M N OP O R S T U V W X Y Z ... Program finished with exit code o Press ENTER to exit console
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
