Encerrado

C++ overloaded functions

Here is the problem that I have for programming...We're supposed to add this stuff to the program example fig 11.1 below.. - Overload the function template printArray of Fig 11.1, so that it takes two additional integer arguments lowSubscript and highSubscript. A call to this function prints only the designated portion of the array. Validate LowSubscript and highSubscript; if either is out=of-range, or if highSubscript is less than or equal to lowSubscript, the overloaded printArray function should return 0; otherwise, printArray should return the number of elements printed. The main to exercise both versions of printArray on arrays a, b and c. Test all capabilities of both versions of printArray. // Fig 11.1: [url removed, login to view] // Using template functions. #include using std::cout; using std::endl; // function template printArray definition template< class T > void printArray( const T *array, const int count ) { for ( int i = 0; i < count; i++ ) cout << array[ i ] << " "; cout << endl; } // end function printArray int main() { const int aCount = 5, bCount = 7, cCount = 6; int a[ aCount ] = { 1, 2, 3, 4, 5 }; double b[ bCount ] = { 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7 }; char c[ cCount ] = "HELLO"; // 6th position for null cout << "Array a contains:" << endl; // call integer function-template specialization printArray( a, aCount ); cout << "Array b contains:" << endl; // call double function-template specialization printArray( b, bCount ); cout << "Array c contains:" << endl; // call character function-template specialization printArray( c, cCount ); return 0; } // end main

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

## Platform

windows xp

Habilidades: Programação C, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: template function cpp, template cpp, std template, programming definition, php main functions, int i, exercise programming, double programming, definition programming, template function, programming functions, programming function, programming example, programming char, programming arrays, programming array, cpp template, cpp return array, cpp programming, cpp program example, cpp array, char programming, array template, array cpp, array programming

Acerca do Empregador:
( 3 comentários ) United States

ID do Projeto: #2960108

31 freelancers estão ofertando em média $10 para este trabalho

benjaminstrahsvw

See private message.

$4.25 USD in 2 dias
(193 Comentários)
7.4
slavas71

See private message.

$12.75 USD in 2 dias
(98 Comentários)
6.5
PASoftware

See private message.

$3.4 USD in 2 dias
(82 Comentários)
6.3
DFlor

See private message.

$12.75 USD in 2 dias
(25 Comentários)
6.2
harisraheem

See private message.

$8.5 USD in 2 dias
(23 Comentários)
6.1
mihaiscortaru

See private message.

$5.92 USD in 2 dias
(158 Comentários)
6.0
finecodervw

See private message.

$12.75 USD in 2 dias
(143 Comentários)
6.0
juliasoft

See private message.

$4.25 USD in 2 dias
(52 Comentários)
5.3
projetcoder

See private message.

$17 USD in 2 dias
(39 Comentários)
5.0
vw139994vw

See private message.

$17 USD in 2 dias
(60 Comentários)
4.5
preyasvw

See private message.

$17 USD in 2 dias
(34 Comentários)
4.4
vw821235vw

See private message.

$6.8 USD in 2 dias
(94 Comentários)
4.3
seirus

See private message.

$5.95 USD in 2 dias
(36 Comentários)
4.0
nlippincottvw

See private message.

$12.75 USD in 2 dias
(4 Comentários)
3.6
vw472664vw

See private message.

$12.75 USD in 2 dias
(36 Comentários)
3.0
inspiredvw

See private message.

$12.75 USD in 2 dias
(1 Comentário)
2.9
lonapz

See private message.

$17 USD in 2 dias
(10 Comentários)
2.8
rundmsef

See private message.

$8.5 USD in 2 dias
(13 Comentários)
2.7
vasilevalaiba

See private message.

$6.8 USD in 2 dias
(9 Comentários)
2.5
kostakliakh

See private message.

$12.75 USD in 2 dias
(4 Comentários)
2.0