Skip to content

Instantly share code, notes, and snippets.

@lxr1017
lxr1017 / Sort
Created September 19, 2016 00:03
/*This program is intended to help you refresh your memory with programming in C++ and consists only of concepts from 146.
Write a program that reads the appropriate number of integers into an array, and sorts these numbers in reverse order
(decreasing order). The data will consist of 3 sets of data (Please use a loop instead of running the program 3 times).
Each set of data begins with an integer that indicates the number of integers on the next newline that are to be read
and sorted. So, unnecessary (i.e., to be ignored-not sorted)numbers may exist in the data.
The 3rd and 5th will be set up like the 1st. Likewise, the 4th and 6th will be set up like the 2nd.
Requirements:
Function to print the array of numbers; pass be value must be used
#include <iostream>
#include <string>
using namespace std;
//Lillian Reynolds
//This program tracks the distances travelled and gallons used for seperate trips.
class Odometer{
public:
void setOdometer(int distance); // resets to 0