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

Create a class named MusicalComposition that contains fields for title, composer, and year written. Include a constructor that requires all three values and an appropriate display function. The child class NationalAnthem contains an additional field that holds the name of the anthem’s nation. The child class constructor requires a value for this additional field. The child class also contains a display function. Write a main()function that instantiates objects of each class and demonstrates that the functions work correctly. Save the file as Compositions.cpp.

Write a funtion using C++ statements called getTotalPraduction() which takes two integer values (value1,value2) and returns the total value


write a c++ program to create a class called date that has separate member data for day month year one constructor should initialize 

this data to 0 and another should initialize it to fixed values .another member function should display it The final member function 

should compare two objects of type date passed as arguments. A main() program should create two initialized date objects(among these one 

should contain today's date and another one should contain your date of birth) and one that isn’t initialized. Then it should compare 

the two initialized values together, leaving the result in the third date variable. Finally it should display the value of this 

third variable. Make appropriate member functions const. 


write a c++ program to create a class called date that has separate member data for day month year one constructor should initialize 

this data to 0 and another should initialize it to fixed values .another member function should display it The final member function 

should compare two objects of type date passed as arguments. A main() program should create two initialized date objects(among these one 

should contain today's date and another one should contain your date of birth) and one that isn’t initialized. Then it should compare 

the two initialized values together, leaving the result in the third date variable. Finally it should display the value of this 

third variable. Make appropriate member functions const. 


//what is the error in this program??
#include <iostream>
#define size 5 
using namespace std;  
int main () { 
int numbers=(5,10,15,20,25,30,35,40};            double total, average;
for (int i;i <size;i++) 
   total+= numbers; 
average = total/size; 
cout << "Average" << average << endl; 
return 0; 
}
Create a class called InputData. It has two private data members data_a (int) and data_b (int). Write a function input() to get input for the attributes from the user and a function display() to display the values of the attributes. The values of these two data members can be returned by using two public functions get_a() and get_b().



*Derive a class called Arith_Unit from InputData. It contains the functions add(), sub(),mul(), div() to perform arithmetic operations on data_a and data_b.



*Derive a class Logic_Unit from InputData. It contains the functions and(), or() and xor() to perform bitwise operations on data_a and data_b.

Write a main() to test functionalities of the Arith_unit and Logic_unit classes.
We are dealing with a 1D array of n integer values.
1. Write a function called InputArray that inputs an array of integers.
We are dealing with a 1D array of n integer values.
1. Write a function called InputArray that inputs an array of integers.
2. Write a function called OutputArray that outputs an array of integers, where each integer
should appear on a different line.
3. Write a function called Minx that receives an array of integers and returns the minimum
value in it.
4. Write a function called Avx that receives an array of integers and returns the average of
its values.
5. Write a function called CountAv that receives an array of integers and returns the count
of repetition of the values that are 1 unit far from the average at maximum.
Example: In [3 2 4 5 1 3], the average is 3 and the numbers that are only 1 unit far are 3, 2, and 4.
There count is 4. You can use two functions

With the concepts of Queue Data Structure, write the functions performing the following tasks:

1.Insertion of an element in the Queue i.e. enqueue()

2.Deletion of an Element from the Queue i.e. dequeue()

3.Display All Elements in the Queue i.e. dispqueue()

4.Display the Element at the Front i.e. dispfront()

5.enqueue() the Queue with the elements in ascending order. After that,use the above four functions to display the same elements in the Queue in descending order.



Design a system that takes is capable of squaring its input 2D array followed by division with scalar ‘R’ For example, if the input array is A[m][n], the output should be A^2[m][n].



LATEST TUTORIALS
APPROVED BY CLIENTS