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]
1 year 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]1 year 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
Retype the paragraph with the corrections. There are 12 corrections. Look closely at the word and letter highlighted in yellow t
Artemon [7]

Answer:

Touch typing is a useful skill. It allows you to increase your typing speed and at the same time and reduces the number of errors you make. Touch typing makes you type faster and more efficient. You can be productive and complete your school assignments much quicker. Touch typing also allows you to type communication documents, like e-mails, in a fast and efficient manner. Most importantly, if you type properly then it will reduce repetitive injuries like carpal tunnel syndrome. There are many benefits of learning how to type correctly.

Explanation:

4 0
2 years ago
What are the pros and cons of the internet’s ability to access information
Shkiper50 [21]
THE PRO IS THAT IT ALLOWS PEOPLE TO RESEARCH INFORMATION. THE CON IS THAT PEOPLE ARE ABLE TO DO MEAN THINGS ON THE INTERNET. FOR EXAMPLE, CYBER-BULLYING. PLEASE HIT THE THANKS BUTTON. :)
3 0
3 years ago
Read 2 more answers
List the steps that you need to locate Microsoft Word on your computer
Olegator [25]
1.click windows start button on the bottom left corner
2. search Microsoft word
3.once Microsoft word is found right click on it
4. then you will see an option called "open file location"
5. then you will have the location of microsoft word
6 0
3 years ago
TWO QUICK QUESTIONS
andrezito [222]
I'm guessing 8? But I'm not 100% positive 
5 0
3 years ago
A __________ note is a private note that you leave for yourself or for other people who might use the presentation file
BaLLatris [955]

Answer:

The answer is that it is a speaker note.

Explanation:

It leaves a note for people that use presentation files. I use it all the time on my google slides.

7 0
2 years ago
Other questions:
  • What are six external parts of a computer
    11·1 answer
  • Describe the following software process models using your own words .Your explanation should also provide an example of a softwa
    12·1 answer
  • Which of the following is NOT a function of the Web Accessibility Initiative​ (WAI)? A. Offering links to a variety of software
    10·1 answer
  • Using PowerPoint or Impressed guarantees that your presentation will do which of the following?
    6·1 answer
  • If data from a DOS system is electronically sent to an EHR or other Windows-based system via an interface to populate an indexed
    7·1 answer
  • Which one is correct
    8·1 answer
  • (2) Design pseudocode for a program that accepts numbers from the user until the special number 555 is entered (you should use a
    12·1 answer
  • How do you know where the home row of the keyboard is?
    14·2 answers
  • A typical day in programming and software development would involve
    7·1 answer
  • Write a FOR loop that displays the following numbers exactly like this (you must use a loop):
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!