Documents

BETWEEN.docx

Description
Description:
Categories
Published
of 2
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Transcript
    Sol, Catherine Jane J. CEIT-37-301A import  java.util.Scanner; public   class  between { public   static   void  main(String[] args) { // TODO  Auto-generated method stub Scanner Between = new  Scanner(System. in ); System. out .println( Type letter A or a, if number and B or b, if letter. ); System. out .println( [A] NUMBER \n[B] LETTER\n ); System. out .print( Enter your choice: ); char  choice = Between.next().charAt(0); if (choice == 'A' || choice == 'a') { System. out .println( \nNUMBER ); System. out .println( This will output the numbers between the first and second number. \n ); System. out .print( Enter the first number: ); int  num1 = Between.nextInt(); System. out .print( Enter the second number: ); int  num2 = Between.nextInt(); if (num1==num2) { System. out .print( Invalid Input\n\n ); } for  ( int  i = num1+1; i< num2; i ++) { if (num1<=100 || num2 <= 100) { System. out .print( i +  ); } } } if (choice == 'B' || choice == 'b') { System. out .println( LETTER ); System. out .println( This will output the letters between the first and second letter. \n ); System. out .print( Enter the first letter: ); char  firstl = Between.next().charAt(0); System. out .print( Enter the second letter: );    char  secondl = Between.next().charAt(0); if (firstl==secondl) { System. out .print( Invalid Input\n\n ); } System. out .println( \n ); firstl++; for ( char  a =firstl; a < secondl; a++) { System. out .print( a + ); } } } } OUTPUT: NUMBER LETTER
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x