# Nester

We manufacture boxes using a machine that make the size of each box based on an a--p random generator. The 2 dimensions of the base of the first box are a and a^2, and second box has dimensions a^3 and a^4, etc. with everything done mod p. We are concerned about whether we can "nest" a lot of boxes so that storage won't be a problem. A sequence of boxes can be nested provided that each successive box can be oriented so that its two dimensions are less than or equal to the two dimensions of its predecessor. So a box of size 2x9 can be nested in a box of size 9x4, but cannot be nested in a box of size 8x7. Create a class Nester that contains a method (function) maxNest that is given a,p and n indicating n/2 boxes that will be manufactured and that returns the largest number of boxes that can be nested in one stack. DEFINITION: Class: Nester Method Signature(function): int maxNest (int a, int p, int n); Your method may assume the following as preconditions: -a and p are between 1 and 2,000,000,000 inclusive and a*p<=2,000,000,000 (so no overflow will occur) -n is an even integer between 1 and 2,000,000,000 inclusive. Here's a test program: int main(){ cout<<" a p n: "; int a,p,n; cin>>a>>p>>n; Nester nester; cout<<"longest nesting is " <<[url removed, login to view](a,p,n)<<endl; return 0; }

## Deliverables

Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. This code should be written using Microsoft Visual C++ 6.0, so that when I compile it I won't get errors or warnings related to compiler differences. I will be asking you why you did what you did, because I need to understand your logic. So either during or after you're done coding, you will need to explain me your algorithm. If you have further questions, pls email me. I need to have this program done by July 11. But I will need you to send me your pseudocode or algorithm before that. Thanks :)

## Platform

Windows 2000, Microsoft Visual C++ 6.0

Concernant l'employeur :
( 4 commentaires ) United States

Nº du projet : #2855846

## 5 freelance font une offre moyenne de \$39 pour ce travail

vw391686vw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(49 Commentaires)
6.3
juanricheri

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(10 Commentaires)
3.5
griddlebone

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(7 Commentaires)
3.5
worldcodervw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(14 Commentaires)
2.5
mo42speep

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(3 Commentaires)
0.8