+ 1
please help me i want to make a program where the program can check my input. ex 1: my input(string) : myprogram then my program print "your input containing 'p'"
8 ответов
+ 3
use control statement for this dudr
+ 3
switch/case will be great for this!!
+ 3
class Simple
{
public static void main (String args [])
{
Char c;
System.out.println ("Enter Any Letter");
c=dis.readLine ();
switch (c)
{
case 'A' : System.out.println ("You Entered A");
break;
case 'B' : System.out.println ("You Entered B");
break;
case default : System.out.println ("Invalid Entry");
}
}
}
+ 3
as #code below
string str;
System.out.println (" Your prefered Letter ");
str=dis.readLine();
switch (str)
case shubham:
System.out.println("this is the name of programmer of this program");
break;
case abc:
System.out.println("details about abc as u want ");
break;
default : System.out.println (" Default or your word ");
+ 2
ex : i want my program can check one letter in one word
+ 2
how about if i want to count how many vocal letter and non-vocal letter in my input?
+ 1
could u be more perticular?
+ 1
it will just need to change the datatype and cases of the switch!!