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
What is a google search query that will search for xml files on the domain example.Com
Natali [406]

Answer:

filetype:xml AND site:example.Com

Explanation:

For this specific scenario, we will use three advanced google's search modifiers: filetype, site & AND

filetype:<em>[abc]</em>

Limit results to files matching the [<em>abc</em>] extension, like <em>pdf</em>, <em>txt</em>, <em>jpeg</em>. In this example xml.

site:<em>[domain]</em>

Limit results to websites containing the [<em>domain</em>] in the url, like .edu, <em>.gov</em>, <em>.brainly.com</em>. In this example example.com.

<em>[condition1] </em>AND <em>[conditon2]</em>

Limits results to those matching both conditions joined by the <em>AND. </em>In this example, the search results must match both filetype AND site domain.

Joining all conditions in a single query:

filetype:xml AND site:example.Com

8 0
3 years ago
11. The golden rule of safe driving is: A. Always drive at the posted speed limit B. Never drive while physically or mentally im
Nonamiya [84]

Your correct answer is A. Always drive at the posted speed limit.

While B. and C. are logically also correct, I wouldn't call them the "golden" rules. Following A. can help you avoid B. to make matters better, hehe.

3 0
3 years ago
In a presentation outline, each slide must represent a main point in the outline.
ivolga24 [154]
This is absolutely true. :D
4 0
3 years ago
Read 2 more answers
Write your own accessor and mutator method for the Rectangle class instance variables. You should create the following methods:
frozen [14]

Answer:

Public int getHeight(){

return height;

}

public int getWidht(){

return widht;

}

public int setHeight(int change){

height = change;

}

public int setWidht(int change){

widht = change;

}

public int getPerimeter(){

int perimeter = 2 ( getWidht() + getHeight ());

return perimeter;

If the width is 10 and height 4, the perimeter should be 28.

Explanation:

An accessor in Java is a method that is used to get the value of an object variable. The program above has three accessor methods, getHeight, getWidht and getPerimeter.

Mutators are methods that is used to change of mutate the value of object variables. They are denoted or identified by the set prefix in their names. From the class code, the mutator are setHeight and setWidht.

7 0
3 years ago
Jeremy is the team leader of the employees planning to display the company’s new product at a big convention. He needs to be sur
Luden [163]
Assuming no options are provided, Jeremy would do well to create a weekly progress report, detailing what the company has accomplished during the week, and what remains to be accomplished. The report should be goal-based with defined deadlines, and clear explanations on what has been done and what remains to be done, and should be organized by the various aspects of the project (accounting, marketing, etc). This report will help keep his team conscience of their role within the larger project, what they have accomplished thus far, and what still needs to be done.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Nathan notices his computer System is slowing down when he tries to copy documents to it he also gets a prompt I warned him that
    7·1 answer
  • Which of these shortcuts becomes available only when text is highlighted?
    10·1 answer
  • When would you use a template when working with word 2013?
    15·1 answer
  • How can the storage model assist in the design of storage networks?
    12·1 answer
  • Write a function findWithinThreshold that identifies the elements of a given array that are inside a threshold value. Takes the
    13·1 answer
  • What tool is used to edit pre-existing range names? (check all that apply)?
    10·1 answer
  • PLEASE HELP!!!
    11·2 answers
  • Data source contains addresses of the merge fields. true or false​
    8·1 answer
  • I will give brainyest
    13·2 answers
  • What is the following file format called? inv_nbr, inv_name, inv_cost 876521,battery,45.00
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!