SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 5 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 07 Jan 2018 My Price 10.00

integers, print them in the order they were entered

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers using an array of integers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order. All numbers entered and displayed will be integer values. All numbers must be validated upon entry. The maximum number of integers to be handled will be 20. Sorting will be done in a function where the array will be the first parameter and the number of integers entered into the array will be the second parameter. Use an array to store the integer values. Use the bubble sort algorithm provided in class. 

  • #ifndef BUBBLE_SORT_H
    #define BUBBLE_SORT_H

    void BubbleSort (char []);

    #endif#include <iostream>

    using namespace std;

    #include "BubbleSort.h"

    void main ()
        {
        char    Letters [] = "qmrzehkjnpuoldawtk";

        cout << "Original letters are: " << Letters << endl;
        BubbleSort (Letters);
        cout << "Sorted letters are:   " << Letters << endl;
        }
    #include <string.h>

    #include "BubbleSort.h"

    void BubbleSort (char Letters [])
        {
        int        i;
        bool    IsSorted;
        int        NumChars;
        char    Temp;

        NumChars = strlen (Letters);
        do    {
            IsSorted = true;
            NumChars--;
            for (i = 0; i < NumChars; i++)
                if (Letters [i] > Letters [i + 1])
                        {
                        Temp            = Letters [i];
                        Letters [i]        = Letters [i + 1];
                        Letters [i + 1]    = Temp;
                        IsSorted        = false;
                        }
                    else;
            } while (!IsSorted);
        }


Answers

(5)
Status NEW Posted 07 Jan 2018 01:01 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)