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 in class MusicDemo that
instantiates objects of each class and demonstrates that the functions work correctly.
Create an Investment class that contains fields to hold the initial value of an investment, the
current value, the profit (calculated as the difference between current value and initial value),
and the percent profit (the profit divided by the initial value). Include a constructor that requires
initial and current values and a display function. Create a House class that includes fields for
street address and square feet, a constructor that requires values for both fields, and a display
function. Create a HouseThatIsAnInvestment class that inherits from Investment and House. It
includes a constructor and a display function that calls the display functions of the parents
java inheritance programs of example music composition
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 in class MusicDemo that instantiates objects of each class and demonstrates that the functions work correctly.
Assume a text file “Test.txt” is already created. Using this file, write a
function to create three files “LOWER.TXT”, which contains all the
lowercase vowels and “UPPER.TXT” which contains all the uppercase vowels
and “DIGIT.TXT” which contains all digits.
. Write a C++ program for implementing the following
a) Create a class called number which will have an array of integers and its size as its members
b) Write member functions for storing data and display data
c) Add all types of constructors
d) Write a member function which takes a character argument, If the argument is E it
should return the sum of all even elements, if it is O it should return the sum
of all odd elements for any other character it should return 0.
Write the function [elems, mns] = nonzero(A) that takes as the input argument a matrix A and
returns all nonzero elements of A in the column vector ‘elems’. The output parameter ‘mns’
holds values of the means of all columns of A.
Rohan was asked by his teacher to develop a program which takes in a dynamic user input and prints all the prime numbers till that number and then prints all the composite numbers till that number. Help him out by developing the program to do so
1. Write a program that reads in a list of integer values one per line and outputs their sum as well as the numbers read with each number annotated to say what percentage it contributes to the sum. Your programs will ask the user how many integers there will be, create an array of that length, and then fill the array with the integers input.
Sam runs a local musical equipment store in your neighbourhood. He has contracted you to create an interactive application that will assist him with customer purchases. Create a class named Customer Purchases that will contain get and set methods for a customer number, first name, surname, product, price and quantity. Create a separate class called Printing that will include a method called Print Details, that will print the Customer Invoice. In the Printing class include another method called Customer Purchase Report which will display the following information: REPORT OPTION PERCENTAGE TAX 15% COMMISSION 8.5% DISCOUNT 10% TOTAL (Price + Tax) – (Discount + Commission)