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
ladessa [460]
4 years ago
11

Write an if statement that tests to see whether a String stored in a variable named phrase begins with a capital letter. If the

string begins with a capital letter, print capital. If not, print not capital . Use at least one method call from the Character class in your solution. You may assume that the string is non-empty (contains at least one character).
Computers and Technology
1 answer:
mamaluj [8]4 years ago
4 0

Answer & Explanation:

//written in java

public class Main {

   public static void main(String[] args) {

       //String stored in a variable named phrase

       String phrase = "Brainly";

       //Checking whether the first character is in upper case or not

       if (Character.isUpperCase(phrase.charAt(0)))

           System.out.println("capital");

       else

           System.out.println("not capital");

   }

}

You might be interested in
How to do pseudocode and flowchart in BMI ( computer programming ​
defon

Answer:

You need to find out what is the units of measurement of the height and weight. You also need to find that the weight is in Kilogram or pounds, and whether the height is in feet and inches, or inches, or meters and centimeters.

Part1: You need to read the values of the weight and height, and validate it as required.

Part2: Now you need to convert those findings into English measures or metrics for computation.

Part3: Output: You need to display as well as echo the input as well as the BMI; and you need to mention the supplementary message which is based on the BMI findings related to Obesity, borderline overweight, normal and overweight, etc.

The program is as below:

import java.io. *;

class Main

{

// weight in pounds and heights are in inches

private double your_wght;

private double your_hght;

Main ( double ht, double wt)

{

your_wght = wt; your_hght = ht;

}

public double GetHght() { return(your_hght); }

public double GetWght() { return(your_wght); }

public double CalculBMI() { return(your_wght*703/(your_hght*your_hght)); }

public double PrintDouble( String promptMessage) throws IOException

{

double Num=0;

String x=null;

Console console = System.console();

System.out.print(promptMessage);  

x = console.readLine();  

Num = Double.parseDouble(x);

return(Num);  

}  

public static void main( String args[])

{

double heightinFeet=0,heightinInch=0,w=0;

Main Input = new Main(0,0);

try

{

System.out.println(" Please input the height(feet/inches) \n");

heightinFeet = Input.PrintDouble(" In feet :> ");

heightinInch = Input.PrintDouble(" In inches :> ");

w = Input.PrintDouble(" Please enter the weight(pounds) :>");

}

catch (IOException ex) { System.out.println("occurred Input Exception"); }  

Main BMI_value = new Main(heightinFeet*12+heightinInch,w);  

System.out.println(" Weight = " + BMI_value.GetWght() );  

System.out.println(" Height(inches) " + BMI_value.GetHght() );

System.out.println(" BMI is " + BMI_value.CalculBMI() );  

}

}

Explanation:

Rest of the fields and properties are self understood, however, PrintMessage needs explanation. It takes a string as input, which calls for entering some double value like in feet, and in inches, and returns that value, which is assigned to relevant double variable. And Main is the class with Main constructor, which is a parameterized constructor, and takes height and weight as input.

5 0
3 years ago
Two electronics technicians are looking at the representations of a silver atom and a copper atom in the figure above. Technicia
eduard
C is your correct answer.
5 0
4 years ago
How do you answer a question on this app?!? Do you comment on the question? I need a reminder! (I haven't been on this app in a
yKpoI14uk [10]
You just click on a question and then you'll see the word "answer" at the bottom of the questions and click on the word to answer the question

6 0
4 years ago
Which of the following file formats is used for art work
Dovator [93]
JPEG. It's most used for art. And PNG is used mostly in websites because it is non-lose compression.
4 0
3 years ago
How do computers use logic?
madreJ [45]
They don’t use any logic
8 0
4 years ago
Other questions:
  • What is scientific and​
    13·2 answers
  • If a = 3 and b = a+3 find value of b.
    14·2 answers
  • What are options in the Advanced tab in the Share Workbook dialog box? Check all that apply
    14·2 answers
  • Cell A1 contains the formula "=10+D2". If you copied A1 to B3, what would be the formula in B3?
    10·2 answers
  • Which files have not been processed by your camera or computer?
    13·1 answer
  • We've managed to get restricted terminal access to a hackers home server which we believe has a secret File
    11·2 answers
  • Write a compound inequality that is represented by the graph.
    14·1 answer
  • The number of pixels displayed on the screen is known as ​
    12·1 answer
  • CC stand for.....in the email platform?
    12·2 answers
  • What's good computing?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!