Here is my code: import java.util.*; import java.lang.String; public class Assig
ID: 440027 • Letter: H
Question
Here is my code: import java.util.*; import java.lang.String; public class Assignment3 { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.print("Input the String: "); String str = keyboard.nextLine(); int ucount = 0; int lcount = 0; for (int i = 0; i < str.length = 0; i++) { char testchar = str.charAt(i); if ((testchar >= 'A') && (testchar <= 'Z')) ucount++; if ((testchar >= 'a') && (testchar <= 'z')) lcount++; } System.out.println("Uppercase = " + ucount); System.out.println("Lowercase = " + lcount); System.out.println("Other = " + str.length() - ucount - lcount); } } This is the error message I keep getting. Assignment3.java:16: error: cannot find symbol for (int i = 0; i < str.length = 0; i++) { ^ symbol: variable length location: variable str of type String Assignment3.java:26: error: bad operand types for binary operator '-' System.out.println("Other = " + str.length() - ucount - lcount); ^ first type: String second type: int 2 errorsExplanation / Answer
you all code got mixed and is difficult to understand please repost it
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.