Create program definition with the templates and methods

Assignment Help C/C++ Programming
Reference no: EM13936914

Directions Points

The file must be called week3-4Prog.cpp

This program will store in miniVector v a list of 15 random integers from 0 to 99, then it will output the vector, sort the vector, then output it again sorted.

Program Definition

1. Create program definition with the following templates and methods:

// output miniVector v
template <typename T>
void writeMiniVector(const miniVector<T>& v);
// use insertion sort to place miniVector v in descending order
template <typename T>
void sortMiniVector(miniVector<T>& v);

Main Method

1. Declare: miniVector<int> v;

2. Declare: randomNumber rnd;

3. call v.push_back(rnd.random(100)); to push 15 entries from 0-99 onto the vector

4. call writeMiniVector to output vector

5. call sortMiniVector to sort the vector

6. call writeMiniVector to output the sorted vector.

After you output the sorted vector:
Include: system("PAUSE"); after your output to pause the screen.

writeMiniVector Method (const miniVector<T>& v)
1. Iterate through the vector v and output each element to the screen.

sortMiniVector Method (miniVector<T>& v)
1. Sort the elements of vector v.

2. Since it is passed-by-reference, no return is necessary.

Example output of your program

Original: 59 18 60 91 49 47 83 93 55 52 15 36 83 56 91

Sorted: 93 91 91 83 83 60 59 56 55 52 49 47 36 18 15

Attachment:- d_except.zip

Reference no: EM13936914

Questions Cloud

Investigate the improvements in the indian common flying : Q1. Investigate the improvements in the Indian common flying industry after the division was opened up for the private players. Assess IA's execution. Why do you think IA neglected to hold its piece of the pie against contenders such as Jet Airways?
Integration of the relevant marketing theory : Insightful and comprehensive identification and discussion of key scholarly literature concerning the specialist marketing topic. • Advanced understanding and integration of the relevant marketing theory.
How pcr can be used in the diagnosis of a genetic disease : Explain how information of the sequence of cloned genes can shed light on the function of their coding genes. Explain how PCR can be used in the diagnosis of a genetic disease.
What variance investigation decisions would be made : Using the ± 2σ rule, what variance investigation decisions would be made? Present SQC charts for round-trip fuel usage for each of the three 747s in October. What inferences can you draw from them?
Create program definition with the templates and methods : This program will store in miniVector v a list of 15 random integers from 0 to 99, then it will output the vector, sort the vector, then output it again sorted.
Objective and subjective comprehension play in under armour : What role does objective and subjective comprehension play in Under Armour's ability to market its products by sponsoring up-and-coming athletes?
Find the dna sequence for the open-reading frame : show the cDNA sequence and corresponding primer sequence for both the upstream and downstream primers. be very clear about any base changes in the primer that are needed to create the restriction site and or maintain the correct reading frame.
Customer service officer in the destiny energy call centre : The problem Write a program that would be used by a customer service officer (CSO) in the Destiny Energy call centre. When a customer calls they will must either provide an account number or a meter number. The CSO will enter this into a text fiel..
Financial statement : Prepare a financial statement for 2014 had

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd