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
Which type of navigation involves multiple frames that are linked to a number of other frames?
sesenic [268]

Answer:

1. b)

2. c)

3. c)

4. a)

5. b)

Explanation:

1. and 5. Linear kind of navigation is a system with a sequential manner web pages that are perfect for some sorts of sites that are having information that has to be viewed as a book (5) and when we are talking about that view we are considering one page after another page like we are reading a book. It is also the simplest navigation. This is the explanation for question 1 and question 5.

2. The most well-designed navigation system is an intuitive one because in this design of the website we have website traffic that is easy because it flows from one web page to another web page. It is showing us where to go to find and look for something and even where to go if there is no concrete options for what are we looking for.

3. A Sitemap is referring to the organized hierarchy of links and it is the protocol that is allowing us to search through many links. A Sitemap is having a listing of the URLs for some site and that is why this is the correct answer.

4. In using liner reciprocal navigation the interface should include how frames are left and how many of them are there. The more the frames, the more times the user will spend on them and the site.

8 0
2 years ago
Which visual aid should Emil use to compare and contrast the political systems in three countries?
BaLLatris [955]
A vent diagram. It helps to outline the differences and the similarities between the three countries
5 0
3 years ago
A student is having trouble finding enough time in his busy schedule to work on his school science project. He has a demanding s
Katena32 [7]

Answer:c

Explanation:

got it rii

3 0
3 years ago
Read 2 more answers
The engine type that is fired by gas or oil
salantis [7]
Internal combustion is the answer
8 0
3 years ago
Read 2 more answers
Maisy is an aspiring video game programmer. She has some unique ideas for new video games, but first, she needs to get some comp
xenn [34]

Answer:

She does not need a computer all she needs are a good laptop that could handle a game engine and a graphic drawing tablet to make the terrain and characters.

Explanation:

It also depends on what kind of game you want to create

6 0
2 years ago
Other questions:
  • Molly wants to make some cells in her balance spreadsheet different colors so that she can more quickly find important data. Wha
    13·2 answers
  • 6 The part of the computer that contains the brain or central processing unit is also known as the ?
    11·1 answer
  • You need to perform maintenance on a router and need to temporarily reroute traffic through another office. which would be the b
    6·1 answer
  • To see all of the records at once, you should use _______ view. 
    12·2 answers
  • Stamps offers at-home postage and mailing for a monthly fee. Customers are able to carry a balance on their accounts that allows
    7·1 answer
  • Data aggregate functions
    6·1 answer
  • The Counter Pattern
    14·1 answer
  • Question 3
    13·1 answer
  • What is the key to satisfaction and success when choosing a career
    15·2 answers
  • Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!