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
S_A_V [24]
2 years ago
9

JAVA...Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter.

Computers and Technology
1 answer:
scoray [572]2 years ago
3 0

Answer:

RecursiveCalls.backwardsAlphabet(startingLetter);

Explanation:

The statement that is needed is a single-line statement. Since the class RecursiveCalls is already in the same file we can simply use that class and call its function without making a new class object. Once we call that class' function we simply pass the variable startingLetter (which is already provided) as the sole parameter for the function in order for it to run and use the letter 'z' as the starting point.

       RecursiveCalls.backwardsAlphabet(startingLetter);

You might be interested in
Write a program that plays the popular scissor-rockpaper game. (A scissor can cut a paper, a rock can knock a scissor, and a pap
kolbaska11 [484]

Answer:

import random

computer = random.randint(0, 2)

user = int(input("scissor (0), rock (1), paper (2): "))

if computer == 0:

   if user == 0:

       print("The computer is scissor. You are scissor too. It is a draw")

   elif user == 1:

       print("The computer is scissor. You are rock. You won")

   elif user == 2:

       print("The computer is scissor. You are paper. Computer won")

elif computer == 1:

   if user == 0:

       print("The computer is rock. You are scissor. Computer won")

   elif user == 1:

       print("The computer is rock. You are rock too. It is a draw")

   elif user == 2:

       print("The computer is rock. You are paper. You won")

elif computer == 2:

   if user == 0:

       print("The computer is paper. You are scissor. You won")

   elif user == 1:

       print("The computer is paper. You are rock. Computer won")

   elif user == 2:

       print("The computer is paper. You are paper too. It is a draw")

Explanation:

*The code is in Python.

Import the random to be able to generate number number

Generate a random number between 0 and 2 (inclusive) using randint() method and set it to the computer variable

Ask the user to enter a number and set it to the user variable

Check the value of computer the computer variable:

If it is 0, check the value of user variable. If user is 0, it is a draw. If user is 1, user wins. If user is 2, computer wins

If it is 1, check the value of user variable. If user is 0, computer wins. If user is 1, it is a draw. If user is 2, user wins

If it is 2, check the value of user variable. If user is 0, user wins. If user is 1, computer wins. If user is 2, it is a draw

8 0
2 years ago
Use semaphore(s) to solve the following problem. There are three processes: P1, P2, and P3. Each process Pi has a segment of cod
Lisa [10]

Answer:

See explaination

Explanation:

Here we will use two semaphore variables to satisfy our goal

We will initialize s1=1 and s2=1 globally and they are accessed by all 3 processes and use up and down operations in following way

Code:-

s1,s2=1

P1 P2 P3

P(s1)

P(s2)

C1

V(s2) .

P(s2). .

. C2

V(s1) .

P(s1)

. . C3

V(s2)

Explanation:-

The P(s1) stands for down operation for semaphore s1 and V(s1) stands for Up operation for semaphore s1.

The Down operation on s1=1 will make it s1=0 and our process will execute ,and down on s1=0 will block the process

The Up operation on s1=0 will unblock the process and on s1=1 will be normal execution of process

Now in the above code:

1)If C1 is executed first then it means down on s1,s2 will make it zero and up on s2 will make it 1, so in that case C3 cannot execute because P3 has down operation on s1 before C3 ,so C2 will execute by performing down on s2 and after that Up on s1 will be done by P2 and then C3 can execute

So our first condition gets satisfied

2)If C1 is not executed earlier means:-

a)If C2 is executed by performing down on S2 then s2=0,so definitely C3 will be executed because down(s2) in case of C1 will block the process P1 and after C3 execute Up operation on s2 ,C1 can execute because P1 gets unblocked .

b)If C3 is executed by performing down on s1 then s1=0 ,so definitely C2 will be executed now ,because down on s1 will block the process P1 and after that P2 will perform up on s1 ,so P1 gets unblocked

So C1 will be executed after C2 and C3 ,hence our 2nd condition satisfied.

4 0
2 years ago
A(n) ____ is an entry in a cell that contains text such as "2016 Sales" or "Travel Expenses."
slavikrds [6]

Answer:

B- label

Explanation:

A label is an entry such as a text within a cell that describes particular rows and columns. Labels are usually found at the top of the particular row/column they are identifying.

Hence, the texts "2016 Sales" and "Travel Expenses" are labels that identify cells such as the values of the sales in 2016 of a company and expenses spent on travel in a year of a family.

6 0
3 years ago
Write a QBASIC program to calculate and display the simple interest.​
Ugo [173]

Answer:

see and write

Explanation:

cls

start

enter"principle"

enter"time"

enter"rate"

p×t×r/100

display result(output)or ans

stop

8 0
3 years ago
Before attempting the​ exercise, click here to watch a short video. Of the following list of tools used at Arnold Palmer​ Hospit
Morgarella [4.7K]

Answer:

A. Flow Charts

Explanation:

A flowchart is simply a graphical representation of steps. It is a diagrammatic representation of an algorithm, workflow or a step-by-step approach to solving a task. Flowcharts use rectangles, ovals, diamonds and potentially numerous other shapes to define the type of step, along with connecting arrows to define flow and sequence.

8 0
2 years ago
Other questions:
  • 1. Perform the following Binary Additions 101101 + 10100 *
    13·2 answers
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • A user wants to make sure he can quickly restore his computer after a drive failure to the state it was in when Windows and all
    9·1 answer
  • How does the speaker feel about traditional forms of poetry
    14·2 answers
  • Please fill these out. I really need this done.
    5·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • 5.8.1: Modify an array parameter. Write a function SwapArrayEnds() that swaps the first and last elements of the function's arra
    14·1 answer
  • Each of the outcomes listed below is a result of executing the following script except for one. Which one? CREATE ROLE ExampleRo
    6·1 answer
  • Can someone please help me I need to turn this in my 3:00pm Eastern time
    12·1 answer
  • 1. Identify one modern technology and discuss its development and discuss what future changes might occur that could have an eve
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!