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]
4 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]4 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
In which career field, would the computing technology industry Associates CompTIAA+ certification be useful?
laila [671]

Answer:

It technical support specialist

3 0
3 years ago
I was wondering how to give a person a Brainliest answer. Could someone please explain to me the steps on to giving someone a Br
alina1380 [7]
When more than 1 person gives an answer to your question, you receive the option to tick the one you think is more well-explained or thought out in order to make that the Brainliest Answer :)
4 0
3 years ago
If you were to create a new app for a smartphone or tablet that does not already exist, what would you create?
omeli [17]
A app that fry’s your Phone or Tablet.
4 0
3 years ago
Select
valentinak56 [21]

Answer:

return values.remove() + values.remove();

Explanation:

The appropriate expression to complete the method, which is designed to return the sum of the two smallest values in the parameter array number is indicated below in bold font :

public static int

sumTwoLowestElements(int[] numbers)

{

PriorityQueue values = new PriorityQueue<>();

for (int num: numbers)

{ values.add(num);

}

return values.remove() + values.remove();  

}

The return statementin programming is often used when a function is ready to return a value to its caller.

6 0
3 years ago
Modify the FitnessTracker class, created in Chapter 4 Programming Exercise 3AB, so that the default constructor calls the three-
Ivenika [448]

Answer:

Is this coding?

Explanation:

5 0
3 years ago
Other questions:
  • Which cloud computing service model gives software developers access to multiple operating systems for testing?
    5·1 answer
  • Technician A says a modern automobile has more than 1 mile of wiring. Technician B says there could be more than 1,000 individua
    15·1 answer
  • HELP I am in the computer lab right now and I need legit reasons why i should work on a laptop instead of a computer. I dont lik
    5·2 answers
  • One cost of starting your own business is _____.
    12·1 answer
  • The Internet began when a large company wanted to sell products online. True False
    15·2 answers
  • Difference between query and filter<br><br>​
    12·1 answer
  • 1) List at least five smaller behaviors you could break the complex behavior "brushing my teeth" into.
    14·2 answers
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • As a basic user of SAP Business One, which feature of the application do you like most? Elaborate on your answer.
    15·1 answer
  • The intelligence displayed by humans and other animals is termed?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!