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
sleet_krkn [62]
3 years ago
12

Write a static boolean method named beginsWithZ. It should accept a String object as a parameter. It should return true if the f

irst character in the String is either of two characters: a capital ‘Z’, or a lowercase ‘z’. (Note: Check the parameter for a null value, and for an empty string. Nulls and empty strings do not start with an ‘z’.)
Computers and Technology
1 answer:
almond37 [142]3 years ago
6 0

Answer:

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

Explanation:

This method is a boolean method, meaning it returns true if the string begins with Z or z and false otherwise. So:

The Java command charAt() let's you find the character at each position of the string, so i use it.

public static boolean beginsWithZ(String word){

if(string == null || string.length() == 0)

return 0;

if(word.charAt(0) == 'Z' || word.charAt(0) == 'z')

return 1;

else

return 0;

}

You might be interested in
Q2: Mark True or False in the corresponding Answer sheet (0.5 point each)
Zinaida [17]

The answers to the question are:

  1. True
  2. True
  3. True
  4. True
  5. False
  6. true
  7. True
  8. True
  9. False
  10. False
  11. false
  12. False
  13. True
<h3>Which words are combined to form malware?</h3>

Malware is known to be a kind of malicious software and it covers  viruses, worms, trojans and other bad computer programs that is often used by hackers to wreak and steal information from system.

The types Of Expansion Cards are:

  • Sound Card
  • Graphics Card
  • Network Interface Card
  • Modem,

A sound card known as an audio card which is said to be an internal expansion card that helps to give input and output of audio message to and from a computer system.

Learn more about  sound card from

brainly.com/question/26964065

#SPJ1

3 0
1 year ago
Price of ETH coin right now?<br> Don't answer if u don't know.
zzz [600]

Answer:

58,715.40

Explanation:

5 0
2 years ago
Which of the following is not a key way that a LAN shares
Lynna [10]

Answer:

I believe it's collaborative software

Explanation:

5 0
3 years ago
When creating a presentation you should use a blank as a starting point?
Lera25 [3.4K]
A blank presentation is recommended as the starting point when creating a PowerPoint presentation.  PowerPoint <span>lets you change the appearance, layout and content of your presentation at any time. Starting with a blank presentation lets you experiment more easily with the many features this program offers.</span>
6 0
3 years ago
What does the National Institute of Standards and Technology do? Promotes innovation by advancing measurement standards promotes
cluponka [151]

Answer:

Promotes innovation by advancing measurement standards

Explanation:

The National Institute of Standards and Technology was Founded in the year 1901, this agency is a non-regulatory body that is found within the United States Department of Commerce.

The mission of this agency is the promotion of innovation and also industrial competitiveness through the advancing of measurement science, standards, and also technology in several ways that raises economic security and also brings about improvement in the quality of life.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Describe mobile computing
    7·1 answer
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • Which of the following is an example of a query with an explicit location? Select all that apply. True False [walmart boston], E
    7·2 answers
  • Can you make copies of classified documents provided you alert others?
    6·1 answer
  • Which of the following is not a metamorphic agent?
    8·2 answers
  • If the variable letter has been defined as a char variable, which of the following are not valid assignment statements to assign
    8·1 answer
  • Sales representatives want to capture custom feedback record details related to each Account. The sales reps want to accomplish
    12·1 answer
  • What is the FTC used car rule
    12·1 answer
  • Determine the value of a and b at the end of the following code segment:
    12·1 answer
  • 2023 murano’s available intelligent awd adjusts the ________ to help maintain cornering control.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!