Write a statement that calls the recursive function BackwardsAlphabet() with parameter startingLetter.#include <iostream>using namespace std;void BackwardsAlphabet(char currLetter){if (currLetter == 'a') {cout << currLetter << endl;}else{cout << currLetter << " ";BackwardsAlphabet(currLetter - 1);}}int main() {char startingLetter;startingLetter = 'z';/* Your solution goes here */return 0;}Please help me with this problem using c++.

Question
Asked Dec 2, 2019
20 views

Write a statement that calls the recursive function BackwardsAlphabet() with parameter startingLetter.

#include <iostream>
using namespace std;

void BackwardsAlphabet(char currLetter){
if (currLetter == 'a') {
cout << currLetter << endl;
}
else{
cout << currLetter << " ";
BackwardsAlphabet(currLetter - 1);
}
}

int main() {
char startingLetter;

startingLetter = 'z';

/* Your solution goes here */

return 0;
}

Please help me with this problem using c++.

check_circle

Expert Answer

star
star
star
star
star
1 Rating
Step 1

Answer:

The statement is used to call the recursive function “BackwardsAlphabet ()” with the “startingLetter” parameter is as follows:

BackwardsAlphabet (startingLetter );

Step 2

Program:

#include <iostream>

using namespace std;

 

void BackwardsAlphabet(char currLetter)

{

if (currLetter == 'a')

{

cout << currLetter << endl;

}

else

{

cout << currLetter << " ";

BackwardsAlphabet(currLetter - 1);

}

}

 

int main()

{

char ...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: How can I create the following table using printf() method?

A: Program algorithm-STARTStep1: Define the class tableStep2: Define the main method.Step3: Use format ...

question_answer

Q: If a non-key column determines a key column, which normal form is violated?A) 1NFB) 2NFC) 3NFD) BCNF

A: BCNF:Boyce – Codd Normal Form (BCNF) is based on functional dependencies that in a relationship all ...

question_answer

Q: DISCUSS HOW THE CRYPTO CURRENCIES OFFER BENEFITS IN THE DOMAIN OF PERSONAL CRYPTOSECURITY?

A: Security In Cryptocurrency:⦁ Cryptocurrency, if once authenticated then no one can reverse it. As we...

question_answer

Q: Im trying to write code for java where the random array that I have genreated are used and then list...

A: Following is the source code with modifications in it. Comments have been added wherever the modific...

question_answer

Q: What is a distributed denial of service attack and how is it possible for a single person to orchest...

A: Distributed denial-of-service (DDoS) attack: After identifying the limitations of flooding attacks w...

question_answer

Q: In C++: Trace all the passes for the selection sort on the array: { 22, 65, 9, 15, 55, 27, 33, 45}

A: Selection sort:The selection sort algorithm sorts an array by finding the minimum element from the u...

question_answer

Q: Given the follwing businessrulea, identify primary keys, foreign keys, attributes, cardinalities.  A...

A: Primary keys: University: U_NameSchools: S_NameDepartments: D_IDProfessors: P_IDCourses: C_ID

question_answer

Q: construct a pda that accepts the language defined by the grammar s → abSb|λ.

A: Constructing PDA:There are two states q and f. q is the start state and f is the final state. Here i...

question_answer

Q: What are different storage classes?

A: The storage classes in C programming language are used set the limitation of variable.These limitati...