1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vaselesa [24]
3 years ago
7

ask user to input a string. (assume length of input string is 1) If the string is lower case, print its upper case If the string

is upper case, print its lower case If the input string is a number, stop program, otherwise repeat it. (In java)
Computers and Technology
1 answer:
Helga [31]3 years ago
8 0

Answer:

import java.util.*;

import java.util.Scanner;

class Main

{

public static void main(String[] args) {

System.out.println("Enter String");

Scanner sc1=new Scanner(System.in);

String s1= sc1.nextLine();

boolean b= isNumerc(s1);

if (b== true)

{

    System.out.println("Its number: Sorry");

}

else

{

boolean a=isStringUpperCas(s1);

if(a == false)

{

    System.out.println(s1.toUpperCase());

}

else

{

    System.out.println(s1.toLowerCase());

}

}

}

private static boolean isStringUpperCas(String st1){

     

     

      char[] arr = st1.toCharArray();

     

      int k =0; boolean flag=true;

      while(k<arr.length)

      {

         

          if( Character.isUpperCase( arr[k] ))

          {

              flag=true;

              k++;

          }

          else

          {

              flag=false;

              k++;

          }

         

      }

      return flag;

}

             

  public static boolean isNumerc(final String st1) {

     

      if (st1 == null || st1.length() == 0) {

          return false;

      }

      for (char ch : st1.toCharArray()) {

          if (!Character.isDigit(ch)) {

              return false;

          }

      }

      return true;

  }

 

}

Explanation:

Please find the program above.

You might be interested in
Sales representatives want to capture custom feedback record details related to each Account. The sales reps want to accomplish
Tomtit [17]

Answer:

Create predefined values for most of the fields.

Create an object-specific action on Account

Explanation:

The sales reps would need to create predefined values for most of the fields, or they can create an object-specific action on account. In doing this, the sales reps will capture custom feedback record details related to each account and will accomplish this with minimal clicks on the Salesforce1 mobile app.

3 0
3 years ago
Which is the most visual social media site?
Rus_ich [418]
That answer would be Twitter
3 0
3 years ago
Read 2 more answers
A/an ____ file saves a workbook as a comma-delimited text file for use on another windows operating system??
aleksandrvk [35]

Answer:

The correct option is D

D) CVS

Explanation:

A CVS file saves a workbook as a comma-delimited text file for use on another windows operating system. It ensures that line breaks, tab characters and other characteristics are interpreted correctly.

A CVS file stands for Comma Separated Value file, which basically allows the data to be saved in tabular format. However they differ from other spreadsheet file types because you can only have a single sheet in a file. Moreover, you cannot save cell, column or row in it.

7 0
3 years ago
If your presentation uses a background, your text should _____.
Klio2033 [76]

your text should work well with the background.

It's very important for the text to be readable.

5 0
3 years ago
Read 2 more answers
1. Which utility would you use to return the common name of the computer you are at?
melamori03 [73]

The utility you would use to return the common name of the computer you are at is Ping.exe. This is the one of the utility which are in first command line utilities. It's easy, first you need to open cmd.exe then you should enter ping-your ip adress, this reveals the TCP/ICP name of the computer you are at.

5 0
4 years ago
Other questions:
  • Each character in a string has a(n) _______________ which specifies its position in the string.
    13·1 answer
  • Which layer of the osi model defines services to segment and reassemble data for individual communications between end devices?
    15·1 answer
  • Which is a disadvantage ofsimulation?
    5·1 answer
  • Which of the following statements are true about gravity? Check all that
    5·2 answers
  • 1. Build and test D-type Flip-Flop using a built-in SR flip-flop.
    12·1 answer
  • It is an electronic device that capable of accessing accepting processing product and storing data​
    13·1 answer
  • What was Bill Gates purpose for starting a business?
    12·1 answer
  • Python code for converting between minutes to seconds. For example 5 minutes= 300 seconds. please help me with this
    7·1 answer
  • A major concern in the home is the __________ of young children. (6 Letters)
    10·2 answers
  • 4.8.4 Better Sum
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!