Reference no: EM13779925
1. Use the following class declarations template < class T, int n>
class TWO
{private: T aln];
public: void ReadData(); // read data into array a
void DisplayData(); //display array a
void SortArray(); //sort array a
-TWO() { }
};
a. Create Two objects P and Q. in object P the array a is type int and size 10, in Q array a is string type and size 12
b. Generate 10 random numbers <20 and store them in array a of object P. Store the name of the month from Dec to Jan in array a of object Q
c. Display the unsorted array a of P and Q
d. Make the SortArray to use the sort member of <algorithm> library to sort the array a of
each object
e. Display the sorted array a of objects P and Q
2. Use the "STACKLlB.h" library to do the following
a. Read a sentence and display it in reverse order
b. Read an integer number <100 and convert it to a new base 2, 8, or 16 Sample I/O
Enter a sentence: Happy Thanksgiving Sentence in reverse order is gnivigsknahTyppaH
Enter an integer number <100: 58
Enter a new base(2,8,16): 2
58 at base 2 is 111010
Try base 8 and 16. Paste all out puts at the end of your program
NOTE 50 at base 8 is 72, and at base 16 is 3A
3. Given two points A(x1, y1) and B(x2,y2), then
A(xl,y1) + B(x2,y2) = (x1+x2, y1+y2)
A(x1,y1) - B(x2,y2) = (x1-x2, y1-y2) K*A(x1,y1) = (k*x1,k* y1)
Write a program to overload the + , -, * operators to add , subtract two points , and multiply a point by constant k. At the end find the distance between the two points.
Sample I/O
Enter the coordinates of point A: 3 4
Enter the coordinates of point B: 5 7
A(2,3) + B(5,7) = C(7, 10)
A(2,3) - B(5,7) = C(-3, -4)
Enter a constant: 4
4*A(2,3)= C(8,12)
The distance from A(2,3) to B(5,7) is xx.xx
Create a one-page flyer that contains advertise
: Create a one-page flyer that contains advertise. A text description about the activities based on the fitness activities detailed above.
|
Recent ethical obligations confronting public administrators
: In 3-4 pages, discuss public interest, administrative responsibility and some of the recent ethical obligations confronting public administrators in their day to day decision making.
|
How does the theory address the problem of crime
: How does the theory address the problem of crime? How are cultural influences on crime integrated into the theory? What solutions for the individual, family, community, and society does the theory suggest
|
Just-in-time materials management
: Discuss your thoughts about just-in-time materials management, its value, shortcomings, and provide an example of where it may be implemented. Below is a brief discussion of JIT vs. MRP. Two approaches have had a major impact on inventory management:..
|
Create two objects p and q and generate 10 random numbers
: Create Two objects P and Q. in object P the array a is type int and size 10, in Q array a is string type and size 12b. Generate 10 random numbers
|
Transmitted illnesses and the social justice framework
: Consider general access to care, maintenance of health and prevention of illness, and treatment of illness. Briefly compare differences in scope (the extent and relevance to the issue of social justice) of two the conditions, obesity and HIV/AIDS...
|
Impact of legislation on organizations
: Your research paper should be no more than three (3) full pages, double spaced, 1-inch margins, in New Times Roman 12-pitch font, with a cover page (name, course number, date, title of paper) and a reference page.
|
Determine the activities of the intelligence community
: There are steps that should be taken that can produce results with minimum errors. These steps, known as the intelligence cycle, include planning, collection, processing, analysis, and dissemination. The intelligence cycle is used to determine t..
|
Neurological disorders that can occur in development
: Write 500 word essay on 2 different neurological disorders that can occur in development and how it affects development, In addition, discuss what research suggests about the effects of spiritual disciplines (prayer, meditation) on neurobiology A..
|