Question

In: Computer Science

this need to import Java.util.Scanner; // Display every character between Unicode 65 and 122 // Start...

this need to import Java.util.Scanner; // Display every character between Unicode 65 and 122 // Start new line after 20 characters public class DebugSix2

{ public static void main(String args[]) { char letter; int a; final int MIN = 65; final int MAX = 122; final int NUMPERLINE = 200; final int STOPLINE1 = 0; final int STOPLINE2 = STOPLINE1 + NUMPERLINE; for(a = MIN; a <= MAX; a++) { letter = (char)a; System.out.print(" " + letter); if((a == STOPLINE1) && (a == STOPLINE) System.out.println(); } System.out.println("\nEnd of application"); } }

Solutions

Expert Solution

Java code for above problem

import java.util.Scanner;
// Display every character between Unicode 65 and 122
// Start new line after 20 characters

class DebugSix2
{
   public static void main(String args[])
   {
       char letter;
       int a;
       final int MIN = 65;
       final int MAX = 122;
       int MAX_CHAR_PER_LINE=20;
      
       int char_count=0;
       for(a = MIN; a <= MAX; a++)
       {
           if(char_count == MAX_CHAR_PER_LINE)
           {
               System.out.println();
               char_count = 0;
           }
           letter = (char)a;
           System.out.print(letter + " ");
           char_count++;
       }
       System.out.println("\nEnd of application");
   }
}

Sample output

Mention in comments if any mistakes or errors are found. Thank you.


Related Solutions

import java.util.Random; import java.util.Scanner; public class Compass { // You will need to do the following:...
import java.util.Random; import java.util.Scanner; public class Compass { // You will need to do the following: // // 1.) Define a private instance variable which can // hold a reference to a Random object. // // 2.) Define a constructor which takes a seed value. // This seed will be used to initialize the // aforementioned Random instance variable. // // 3.) Define a static method named numberToDirection // which takes a direction number and returns a String // representing...
What is the relationship between the ASCII Latin-1 character set and its Unicode equivalent that makes...
What is the relationship between the ASCII Latin-1 character set and its Unicode equivalent that makes conversion between the two simple?
import java.util.Scanner; public class MonthsOnAndAfter { // You will need to write a method that makes...
import java.util.Scanner; public class MonthsOnAndAfter { // You will need to write a method that makes this // code compile and produce the correct output. // YOU MUST USE switch! // As a hint, you should not have to use the name of each // month more than once. // TODO - write your code below this comment. // DO NOT MODIFY main! public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter month (0-11): "); int month...
import java.util.Scanner; public class Months { // You will need to write a method that makes...
import java.util.Scanner; public class Months { // You will need to write a method that makes this // code compile and produce the correct output. // YOU MUST USE switch! // TODO - write your code below this comment. // DO NOT MODIFY main! public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter month (0-11): "); int month = input.nextInt(); String output = monthAsString(month); System.out.println(output); } }
NEed UML diagram for this java code: import java.util.ArrayList; import java.util.Scanner; class ToDoList { private ArrayList<Task>...
NEed UML diagram for this java code: import java.util.ArrayList; import java.util.Scanner; class ToDoList { private ArrayList<Task> list;//make private array public ToDoList() { //this keyword refers to the current object in a method or constructor this.list = new ArrayList<>(); } public Task[] getSortedList() { Task[] sortedList = new Task[this.list.size()];//.size: gives he number of elements contained in the array //fills array with given values by using a for loop for (int i = 0; i < this.list.size(); i++) { sortedList[i] = this.list.get(i);...
Need to able to solve this method WITHOUT using ANY java libraries. ------------------------------ import java.util.Scanner; public...
Need to able to solve this method WITHOUT using ANY java libraries. ------------------------------ import java.util.Scanner; public class nthroot { public static void main(String[] args) { Scanner sc = new Scanner(System.in);    // Read n (for taking the nth root) int num = Integer.parseInt(sc.nextLine());    // Read number to take the nth root of int number = Integer.parseInt(sc.nextLine());    // Read the desired precision int precision = Integer.parseInt(sc.nextLine());    // Print the answer System.out.println(findnthRoot(number, num, precision)); }    private static String...
Display 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, …, 626. Loop...
Display 10, 17, 26, 37, 50, 65, 82, 101, 122, 145, 170, 197, …, 626. Loop or While Multiply all even numbers from 2 to 12 and show the final result. USING HTML JAVASCRIPT
Please answer it without plagiarism. If you need $750,000 to start a venture, reasoning between financing...
Please answer it without plagiarism. If you need $750,000 to start a venture, reasoning between financing the $750,000 through debt vs equity. What would be the impact on the balance sheet, income statement, and cash flow statement?
If you need $750,000 to start a venture, reasoning between financing the $750,000 through debt vs...
If you need $750,000 to start a venture, reasoning between financing the $750,000 through debt vs equity. What would be the impact on the balance sheet, income statement, and cash flow statement?
If you need $750,000 to start a venture, reasoning between financing the $750,000 through debt vs...
If you need $750,000 to start a venture, reasoning between financing the $750,000 through debt vs equity. What would be the impact on the balance sheet, income statement, and cash flow statement?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT