conditional constructdn(chap 8)_084604
conditional constructdn(chap 8)_084604
} if (unit<=100)
{
} amount=350;
} }
//Q12 greatest value among three numbers if (unit>100 && unit<=200)
class Q12 {
{ amount=350+(unit-100)*1.90;
void numdigit(int num) }
{ if (unit>200 && unit<=300)
int digit,ctr=0,s=0; {
while(num!=0) amount=350+100*1.90+(unit-200)*2.90;
} Q20
if (unit>300) import java.util.*;
{ class Q20
amount=350+100*1.90+100*2.90+(unit- {
300)*3.90; void dheck()
} {
System.out.println("amount of Scanner obj =new Scanner(System.in);
bill="+amount); System.out.println("enter character");
}
} char ch=obj.next().charAt(0);
Q18 /* Switch(ch)
//q18 {
import java.util.*; case 'A':
class q18 System.out.println(**/
{ if (ch>=65 && ch<=90)
void digitword()
{ System.out.println("capital letters");
Scanner obj =new Scanner(System.in); else if(ch>=97 && ch<=122)
System.out.println("enter digit"); System.out.println("small letters");
int n =obj.nextInt(); else
char ch=obj.next().charAt(0); System.out.println("special
switch(ch) characters");
{ }
case 'a': }
/* switch(n)
{
case 1:
System.out.println("one");
break;
case 2:
System.out.println("two");
break;
case 3:
System.out.println("three");
break;
case 4:
System.out.println("four");
break;
case 5:
System.out.println("five");
break;
case 6:
System.out.println("six");
break;
default:
System.out.println("wrong choice");**/
}}}