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
Naddika [18.5K]
3 years ago
7

Write a function that will alphabetize a string WITHOUT using the sort function :

Computers and Technology
1 answer:
Dimas [21]3 years ago
7 0

Answer:

here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function to alphabetize the input string

void alphabetize(string &str)

{

// find the length of string

 int n=str.size();

 

  for(int x=0;x<n;x++){

      for(int y=x+1;y<n;y++)

      {  

          //swap the character

          if(str[x]>str[y]){

              char ch=str[x];

              str[x]=str[y];

              str[y]=ch;

          }

      }

  }

 

  cout<<"alphabetize string is: "<<str<<endl;;

 

}

int main()

{// string variable to read input

  string inp;

 

  cout<<"Please Enter a String in lowercase :";

  //reading the input

  cin>>inp;

  // call function with inp argument

  alphabetize(inp);

  return 0;

  }

Explanation:

Declare a variable "inp" of string type and assign the input string to it. call the alphabetize() function with argument "inp".In the alphabetize(),find the length  of input string.Then travers the string and if a character is greater than any  next character in the string then swap it, so that all the character are sorted.

Output:

Please Enter a String in lowercase :helloworld                                                                                                                

alphabetize string is: dehllloorw

You might be interested in
A _____ is a web site that allows users to edit and change its content easily and rapidly.
Ivenika [448]

The web site you are looking for is Wiki, web application that allows users to easily add and edit content on a web page.

7 0
3 years ago
Which of these network connections would allow your smartphone to sync your photos to your online account? Choose all that apply
Anika [276]

Answer:

A & D

Explanation:

Wifi or IEEE 802.11a/n/g  is a wireless network medium used for communication between devices in a network (or the internet). It is used to transfer video, text, graphic, audio and all other types of files.

Cellular is a mobile networking technology used to make wireless communication over a large area of land called cell, between devices in a network or a remote network.

Both cellular and wifi connections are used to synchronize smartphones to online accounts and allows for data backup and retrieval.

5 0
3 years ago
You are a cleared employee. Your friend called and told you that he saw information about the classified XYZ program on the Inte
m_a_m_a [10]

Answer:

Yes, because though you are a cleared employee, the classified information should not be open for all employees to see as it is a data disclosure violation.

Explanation:

Data is a vital tool in the business industry. The need to secure data or present it to be seen by competitors is very crucial as it maintains the dominance of a company on its competitors.

Only authorized employees in a company are allowed to view classified data and must report any siting of data spill, to avoid prosecution.

3 0
3 years ago
A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
andreev551 [17]
The answer to your question is true
6 0
3 years ago
Plz answer and dont put a random thing for the points
Anton [14]

<u><em>answer</em></u>: it it mostly likely to be the one that says "choose font style"

<u><em>explain</em></u>: im in advanced tech class so i think i know what this is:D

hope i helped you!:D

6 0
3 years ago
Other questions:
  • Laura is using studio lighting while photographing a model. The four elements that she will use in studio lighting are hot light
    10·1 answer
  • Which is missing in most areas that do not have Karst topography?
    10·2 answers
  • Edmund wants to create a website for his university. He has created all the necessary content and now wants to style and format
    11·1 answer
  • What is used to determine when the communications channels are clear and when a device is free to transmit data
    6·1 answer
  • Which is an advantage of setting bookmarks?
    15·1 answer
  • Pls help me!!!!!!!!!!!!!
    5·2 answers
  • Backordered Parts is a defense contractor that builds communications parts for the military. The employees use mostly Web-based
    10·1 answer
  • How many dog breed are there
    9·2 answers
  • List six common raster image file types.
    9·1 answer
  • Help me. thank you very much
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!