Write a program that creates a class called Pizza. The data members of the class are size (inches), topping, price (PKR)
and thickness (cm). Through the use of a constructor, initialize the class object and assign default values to data
members. Determine whatis public and private in the class. Add setter and getter method for each attribute. Write a
global function “Display” (should not be member of class) that is able to print all information of a single Pizza object
on screen. In main() function, make an array of 5 Pizza objects with different values and print information of all
objects on screen thru Display function.
1.i)Create a class to hold all student attribute (name,reg number, course , gender and age) a read details method which interact with a user and read students details write details method to print write student details.
ii) create a main function which will prompt a user to enter student details call function read details and write details from a class above to read and write student detail respectively
write a program to store the data of mobile shop in a file with appropriate data members and member functions. use read and writes method to perform the file operations. read only the price and model value of mobile from file.
Define a class ABC. Derive two classes BBC and KBC from ABC. All the classes contains same member function name as display(). The base class pointer always holds the derived class objects.
a) Write a program such that base class pointer or reference will always access/call the base version of the members available in derived class, do not have any access to the derived class members.
b) Write a program such that base class pointer or reference will always access/call the derived version of the members available in derived class, do not have any access to the base class members.
Write down the concepts used for bit a) and b) separately.
Write a program such that base class pointer or reference will always access/call the derived
version of the members available in derived class, do not have any access to the base class
members.
Write a program such that base class pointer or reference will always access/call the base version of the members available in derived class, do not have any access to the derived class members.
Define a class ABC. Derive two classes BBC and KBC from ABC. All the classes contains same
member function name as display(). The base class pointer always holds the derived class objects.
Write a program that contains a function that displays' Welcome to CS127-8L!" Then, it asks for a double value such as 25.36, 100.02 etc. The maximum is 1000. Getting the function displays the value in words. Please see the sample runs below.
Run 1
Welcome to CS127-8L!
Enter a double value: 255.36
That is two hundred twenty-five and thirty-six centavos!
Run 2
Welcome to CS127-8L!
Enter a double value: 800.20
That is eight hundred and twenty centavos!
Write a program that has 3 data members of int type the program take sum of 3 members and then return the square of each number by using public inheritance
Write a C++ program segment to assign data to members of a STRUCTURE called EMPLOYEE having name, age and salary then display it.