Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Draw avl tree diagram using the following keys

12,13,44,43,99,0,88,13,43,2,22

Draw diagram after each step

Note:

No code required only diagrams after each step are needed.


You have been contracted by client to develop a program using c++. The Program must have the
following specifications.
The program must:
a. Allow the user to enter the full name of the university - “Ghana Communication Technology
University”.
b. Print the entire name for the university.
c. Count the number of ‘e’ in “Ghana Communication Technology University” and display.
d. Print the last 21 characters in “Ghana Communication Technology University”.
e. Replace the string “Ghana” in “Ghana Communication Technology University” with “Accra”
and print the new name.

A housing society is represented by a 3D plane. We have a class house which

stores the location of a house of three persons using x, y and z coordinates of

plane. Another class market which stores the location of a main market. Each class

should initialize the data members using parameterized constructor. Keep the data

members of all the classes private. Also display the location of houses and market.

Calculate the distance of houses of all the persons from the market and display

which person’s house is far away from the market. Also display which person has

nearest distance from the market.

The class manager has the access to both class house and market so it swaps the

location of the market with the house of a person that has the largest distance

with the market. in C++


The Ghana Navy has been paying its newly employed staff on ‘table-top’, a practice that has attracted much criticism from the military command. On a trial basis they have engaged your services to design a payment system with the following functionalities.
Write a program to create a class for counting the number of objects created
and destroyed within various block using static data member, constructor
and destructors.
Write a program using copy constructor to copy data of an object to another
object.
#include <string>
using namespace std;
struct book
{
string title;
string author;
unsigned int year;
};
int main()
{
book bookrec;
cout << “Enter Book Title:”; getline(cin,bookrec.title);
cout << “Enter Book Author:”; getline(cin,bookrec.author);
cout << “Enter Publication Year:”; cin >> bookrec.year;
cout << “The following information has been received…\n”);
cout << “Book Title:” << bookrec.title;
cout << “Book Author:” << bookrec.author;
cout << “Year Published:” << bookrec.year << “\n”;
system(“pause”);
return 0;
}


Modify Program Sample-1 by applying a structure array in the program. The program should accept 5 records of books and displays them on the screen.
The program should also include two functions: (1) a function for entering book information; and (2) a function for displaying the records.

Simulate the fragment of codes below and trace the output. 


int *p1, *p2;

p1 = new int;

p2 = new int;

*p1 = 10;

*p2 = 20;

cout << *p1 << “ ” << *p2 << endl;

p1 = p2;

cout << *p1 << “ ” << *p2 << endl;

*p2 = 30;

cout << *p1 << “ ” << *p2 << endl;


Write a program that will prompt the user to input the following:

 

1. The number of dice to be rolled.

2. How many times the dice should be rolled?

Since the values above will vary, you must use pointer arrays and dynamically allocate memory.

The program will store the total of faces per roll and the values will be later used to plot a graph. The graph should look like the output shown below

3:

4:

5:

6:

7:

8: *

9:

10:

11:

12: *

13:

14:

15:

16:

17:

18:

 

The asterisk (*) tallies the number of times that total has occurred. 3 and 18 are the minimum and maximum totals, respectively, for rolling 3 dice.

The declaration and implementation sections of the class have been defined for you. Use it to complete your program.




Wap to create One Base class Father data member fname. And Son class derived from Father dada member sname . And GrandSon derived from Son data member gname. Use appropriate function that GrandSon will display all name by it concatenating


LATEST TUTORIALS
APPROVED BY CLIENTS