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
Vlada [557]
3 years ago
11

The str method of the Bank class returns a string containing the accounts in random order. Design and implement a change that ca

uses the accounts to be placed in the string by order of name. (Hint: You will also have to define some methods in the SavingsAccount class.) Grading When you have completed your program, click the Submit button to record your score.
Computers and Technology
1 answer:
Anna007 [38]3 years ago
8 0

Answer:

using namespace std;

// function to print string in sorted order

void sortString(string &str)

{

  sort(str.begin(), str.end());

  cout << str;

}

// Driver program to test above function

int main()  

{

   string s = "pleaseordertheaccounts";

   sortString(s);

   return 0;

}

Explanation:

<em>It can also work like:</em>

using namespace std;

int main()

{

       char str[5][20], t[20];

       int i, j;

       cout<<"\n Enter Any Five Names : \n\n";

       for(i=0; i<5; i++)

       {

               cout<<" ";

               cin>>str[i];

       }

       for(i=1; i<5; i++)

       {

               for(j=1; j<5; j++)

               {

                       if(strcmp(str[j-1], str[j])>0)

                       {

                               strcpy(t, str[j-1]);

                               strcpy(str[j-1], str[j]);

                               strcpy(str[j], t);

                       }

               }

       }

       cout<<"\n Names Sorted in Alphabetical Order : \n\n";

       for(i=0; i<5; i++)

       {

               cout<<" ";

               cout<<str[i]<<"\n";

       }

       return 0;

}

You might be interested in
Apache web server is the most widely used network operating system used on web servers.
Zarrin [17]
The statement that Apache web server is the most widely used network operating system used on web servers is true. This server runs on <span>67% of all webservers in the world</span>
The Apache web server is a free and open-source cross-platform HTTP Server,<span> developed and maintained by </span>Apache Software Foundation.
7 0
3 years ago
Read 2 more answers
In C++ we can print message for the user in Arabic?<br><br> A. True<br> B. False
Lynna [10]

Answer:

A

Explanation:

8 0
3 years ago
Which statement is true regarding Artificial Intelligence (AI)?
Effectus [21]
Data is the fundamental reason AI succeeds or fails.
This statement is true regarding Artificial Intelligence (AI)
6 0
3 years ago
Answer for a, b, and c
Darya [45]

The answer is a. im pretty positive but if im wrong super sorry

5 0
3 years ago
In three to five sentences, explain the function of the computer's operating system.
Sati [7]

Answer:

An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Explanation:

3 0
3 years ago
Other questions:
  • Online library catalogs can direct you to your closest library. (1 point)<br> True<br> False
    8·1 answer
  • What is software that, while purporting to serve some useful function and often fulfilling that function, also allows Internet a
    11·1 answer
  • Is downloading like installing?
    13·1 answer
  • Which of the following is true of horror films like Insidious and The Conjuring?
    15·2 answers
  • 50 POINTS How do you express yourself and your creativity through computer science?
    12·1 answer
  • Use the drop-down menus to explain how to locate the Consolidate dialog box.
    6·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • Employees in your organization regularly need to print sensitive documents. The employees properly dispose of the hard copies of
    14·1 answer
  • Which popular video game franchise has released games with the subtitles World At War and Black Ops?
    10·2 answers
  • What is bigger that terbites
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!