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
​What file system below does not support encryption, file based compression, and disk quotas, but does support extremely large v
Elena L [17]

Answer:

D.  ReFS

Explanation:

File system is simply a management system for files that controls how and where data are stored, where they can be located and how data can be accessed. It deals with data storage and retrieval.

Examples of file system are NTFS, FAT(e.g FAT 16 and FAT 32), ReFS.

ReFS, which stands for Resilient File System, is designed primarily to enhance scalability by allowing for the storage of extremely large amounts of data and efficiently manage the availability of the data. It is called "resilient" because it ensures the integrity of data by offering resilience to data corruption. It does not support transaction, encryption, file based compression, page file and disk quotas, to mention a few.

6 0
3 years ago
Select a correct statement regarding a hashing process.
kogti [31]

Answer:

a) It is used for authentication.

Explanation:

Hashing is a process of transforming a single key into another value. It generates the values using a mathematical algorithm. the outcome of this process is a hash value or a hash.

The hashing process is used for authentication.

The hashing process is not reversible.

The hashing process is used to create the digital signature.

The outcome of the hashing process is the hash value, not a message.

4 0
3 years ago
You are installing a webcam in the screen bezel of your laptop. Prior to disassembling the laptop, what other devices in the scr
guapka [62]

Answer:

a. Microphone

d. Wi-Fi antenna

Explanation:

The wifi antenna , is present in the screen bezel , and the two cables are connected to the motherboard and the wifi adapter .

Hence , we need to be aware of the wifi antenna , before installing the webcam .

Microphone , as in most of the laptop , the microphone is present just near the screen bezel , and hence , need to be aware of before the installation process of the webcam .

7 0
3 years ago
Read 2 more answers
7.<br> Question<br> What port does the File Transfer Protocol (FTP) typically listen on?
nikdorinn [45]

Answer:

Port 21

Explanation:

FTP protocol typically makes use of Port 21, which is the main port for communication. The FTP clients get connected to the FTP server through the Port 21 and then does the required conversation. Hence, the correct option here is Port 21.

7 0
3 years ago
Will a logic error be found if a program is compiled?
natali 33 [55]
No. The computer dose not understand what you are attempting to do, therefore it will not understand how to check for logic errors. The compiler will only check for syntax errors.
6 0
3 years ago
Other questions:
  • Write a program that allows a user to input words at the command line. Your program should stop accepting words when the user en
    10·1 answer
  • Write a program that asks the user to input four numbers (one at a time). After the four numbers have been supplied, it should t
    6·1 answer
  • How long does it take a letter to arrive?
    9·1 answer
  • Which of the following might indicate a source on the internet is NOT reliable?
    6·1 answer
  • Which task can a company perform with intranets
    8·1 answer
  • What is net pay?<br> What is net pay?
    11·2 answers
  • Which terms means device that converts one voltage to another ?
    15·1 answer
  • Please could you help me
    6·2 answers
  • When creating an HTML document, what do we use to set aside space for content?
    14·1 answer
  • Examples of how the development of coding changed the way we live. What type of technology was created as a result of code?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!