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
An Excel file that contains one or more worksheets
lutik1710 [3]

Answer:

three sheets

Explanation:

A workbook is an Excel file that contains one or more worksheets. Each of the workbook 039;s worksheets are in separate tabs on the bottom of the Excel window. By default, a new Excel workbook will contain three worksheets.

7 0
3 years ago
Which of the following software programs provides for e-mail communication?. A. Access. B. Word Perfect. C. Outlook. D. Excel
torisob [31]

There are several software programs and internet applications that you use to send electronic mail (e-mail) to other people. However, for programs that are part of the Microsoft Suite, only one provides this ability, which is (C) Outlook.  

Microsoft Access is used to manage databases, while Microsoft Excel is used to analyze numerical and text data. WordPerfect is a word processor software created by Corel.  


5 0
3 years ago
Read 2 more answers
Which cpu type would most likely be found in a smartphone?.
dlinn [17]

Answer:

dual-core (two), quad-core (four) and octa-core (eight)

Explanation:

These are the most common according to my research.

If I helped you, can I please have brainliest?

Have a great day/night!

4 0
2 years ago
How will advertising and communications change as technology improves?????? HELP PLEASE :0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
drek231 [11]

Technology changes advertising and communications by increasing the outreach of people that will get the message, and increasing the speed at which they get the message. Which in turn makes the advertising more relevent because they can release more product to a wider audience during a specific time period.


6 0
3 years ago
Which heat transfer can be described as currents of warm air rising and cool air falling
erik [133]
Convection would be the answer to thisssss

3 0
3 years ago
Other questions:
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • By applying styles formats are being applied ?
    14·2 answers
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • One study found that nearly ____________ of the 1600 college freshmen surveyed had sent sexually suggestive texts or photos.
    11·1 answer
  • If you filmed a clip in 120fps, how many frames are in a seconds of video.
    13·1 answer
  • Write a program to read 10 integers from an input file and output the average, minimum, and maximum of those numbers to an outpu
    14·1 answer
  • During which phase of the website transformation processwould the project team for developing perform content analysis, layout t
    13·1 answer
  • Help me please I’m failing
    11·1 answer
  • . Which responsibility belongs to the marketing function?
    11·1 answer
  • Say true or false
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!