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
vfiekz [6]
2 years ago
5

Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.

b) Create a function, printLetters() to output the array. c) Create a function, swap() for swapping character variables. d) Create a function, reverseLetters() uses a loop and the swap() to reverse all array elements. e) Call printLetters()to Output the updated array. Hint: Set a variable for the first and last indices. Swap those values. Gradually move the first/last pointers to the middle of the array, swapping as you go. When the middle is reached, the array will be reversed.
Computers and Technology
1 answer:
WARRIOR [948]2 years ago
6 0

#include <fstream>

#include <iostream>

#include <iomanip>

#include <cstring>

#include <cstdlib>

using namespace std;

// Function Declarations

void display(char alphabets[],int MAX_SIZE);

void reverse(char alphabets[],int MAX_SIZE);

void swap(char &ch1,char &ch2);

int main() {

 //Declaring constant

const int MAX_SIZE=26;

 

//Declaring a char array

char alphabets[MAX_SIZE];

 

//Populating the array with alphabets

for(int i=0;i<MAX_SIZE;i++)

{

 alphabets[i]=(char)(65+i);

 }

 

 cout<<"Original: ";

 display(alphabets,MAX_SIZE);

 reverse(alphabets,MAX_SIZE);

 cout<<"Reversed: ";

 display(alphabets,MAX_SIZE);

 return 0;

}

//This function will display the array contents

void display(char alphabets[],int MAX_SIZE)

{

 for(int i=0;i<MAX_SIZE;i++)

 {

    cout<<alphabets[i]<<" ";

 }

 cout<<endl;

}

//This function will reverse the array elements

void reverse(char alphabets[],int MAX_SIZE)

{

 int first,last;

 first=0;

 last=MAX_SIZE-1;

 

 while(first<last)

 {

   

    swap(alphabets[first],alphabets[last]);

    first++;

    last--;

   

 }

}

void swap(char &ch1,char &ch2)

{

 char temp;

 temp=ch1;

 ch1=ch2;

 ch2=temp;

You might be interested in
Assume that print_error_description is a function that expects one int parameter and returns no value. Write a statement that in
murzikaleks [220]

Answer:

The program to this question can be given as:

Program:

#include<stdio.h> //include header file.

void print_error_description(int x)  //function definition

{ //body of the function

printf("The value of the parameter is = %d",x); //print value.

}

int main()  //main method

{

print_error_description(14);  //calling a function

return 0;  

}

Output:

The value of the parameter is = 14

Explanation:

According to the question we define a function that is "print_error_description()". In this function we pass an integer element that is x. In this function we use void as a return type because this return type does not return any value. In the main method we call the function and pass the value that is 14.

5 0
3 years ago
Que es la fisiconometria?
Anni [7]

Answer:

it is a field of study concerned with the theory and technique of psychological measurement.

or

Medición de las funciones mentales en general y de las características psíquicas de los individuos en particular.

Explanation:

8 0
3 years ago
True or false? LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to se
vfiekz [6]
<h2>Answer:</h2>

The following statement is TRUE.

LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to see where you stand as compared to your classmates in terms of your mastery of grammar and vocabulary concepts.

<h2>Explanation:</h2>

LearnSmart is an adaptive technology that is helping a lot of students by letting them judge which parts/topics of the book are not clearly learnt by them and which of them are under their grip.

LearnSmart provides cards with short term questions that make i possible for students to complete their preparation in short time. In addition to this smart flash card assignments are a to compare students preparation relatively.

<h3>I hope it will help you!</h3>
4 0
3 years ago
Explain how will you know the number of slides used in the presentation.​
EastWind [94]
You can tell the number of slides used in a presentation by looking to the left of the screen on the title page and it will show you. This also depends on what site you are using
8 0
3 years ago
A benefit of IPsec is __________.
Montano1993 [528]

Answer:

Option (4) is correct answer

Explanation:

IPsec stands for Internet protocol security. It is a protocol that works between two communication points. It provides integrity, confidentiality and data authentication for any network. It is used for Virtual private network.  There are two types of VPN, From which an organization needs to choose one.

IPsec and OpenSSl in which IPsec VPN uses IP security.

Benefits of this network are as follows--

  • Option 1 states that it works after the transport layer which is true.
  • Option 2 states that when any user leaves the organization they have no need to take back the martial which he had already provided to the organization which is also the benefit of IPsec.
  • Option 3 states that it provides security that is also correct because it is a protocol that is designed to provide security.

Hence option D (all of the above ) are correct.

3 0
3 years ago
Other questions:
  • You have been asked to create an authentication security plan for your company. Which of the following components would you inco
    14·1 answer
  • Eye injuries usually occur as a result of all of the following things, EXCEPT:
    13·2 answers
  • Jackson is teaching the decimal number system. He wants his students to know how to expand numbers by powers of 10. Which is the
    13·2 answers
  • Which of the following is an example of an analog medium?
    13·1 answer
  • What is the result of giving the which utility the name of a command that resides in a directory that is not in your search path
    10·1 answer
  • Create a cell reference in a formula by typing in the cell name or
    7·2 answers
  • You have a brand-new monitor and you want to make sure you are getting the most out of it. For this reason, you decide to alloca
    13·1 answer
  • Consider a direct-mapped cache with 256 blocks where block size is 16 bytes. The following memory addresses are referenced: 0x00
    7·1 answer
  • if you were determining what was expected of you simply by looking at media, what messages would you take away?
    8·2 answers
  • How to test someone elese internet speed from a distance
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!