Create a class named Fruit with a
data member to calculate the number
of fruits in a basket. Create two other
class named Apples and Mangoes
derived from class Fruit to calculate the
number of apples and mangoes in the
basket. Print the number of fruits of
each type and the total number of fruits
in the basket.
Write a program which has a class named binary which has a character array to store a binary string. The class decimal derives from class binary and contains an integer data member. Another class called octal also derives from binary. Each class should contain constructors and appropriate data members to input and display the elements. The display function of binary class displays the binary equivalent, octal class’s display function displays octal equivalent whereas decimal class’s display function displays the decimal equivalent
Data should be read from a file using a comma delimited format
Use a linked list to store the Course schedule while in memory
Allow the user to display all courses
Allow the user to add courses
Allow the user to delete courses
Save the data at the end of the program. Use at least two structures and one enum.
EX: Computer Science I, CSC110, Mon, Wed, 8:00, 9:00, Online, Zoom, Instructor
Use finite difference approximations of O(h²) to compute f'(2.36) and f''(2.36)
from the data :
x = 2.36 2.37 2.38 2.39
f(x) = 0.85866 0.86289 0.86710 0.87129
Q1: Write a Program in C++ which completes following requirements:
a. Create a class, having a static function printing some information and invoke that method using scope resolution operator.
b. Try to access non-static data members from static method and write in comments what happens.
c. Declare and initialize a static variable as counter in a function (increment it in every call) and call it multiple times printing the change in value
d. Write about your observations while making this assignment in a word file about static variables and static methods
Q1: Write a Program in C++ which completes following requirements:
a. Create a class, having a static function printing some information and invoke that method using scope resolution operator.
b. Try to access non-static data members from static method and write in comments what happens.
c. Declare and initialize a static variable as counter in a function (increment it in every call) and call it multiple times printing the change in value
d. Write about your observations while making this assignment in a word file about static variables and static methods.
Using while loop and If statements, print all the letters in the following string except for the letter ‘g’ and ‘o’. (5 marks)
‘goodbyemybaloon’
Hint: use continue keyword. Continue and Break are keywords to control the flow of a loop. Continue keyword returns the control to the beginning of the loop. Now try using the break keyword and see what happens. Expain your findings.
Accept 10 numbers from the user and calculate their sum.