Write a c++ program to define a class for calculater with data members 1&member2(both as double) and methods as add() ,sub() ,mil(), div() create a array of 5 objects of calculater use paramaterized constructor to intialize the value.display output of all four arthmetic operator.
1. Create a class: “Prime” with private data members: upper_limit (int), lower_limit (int) and parameterized constructor, which initializes the values of both data members. Apart from initialization, this constructor also displays the count of prime numbers from upper_limit to lower_limit. [Example: upper_limit:15, lower_limit:10, count of prime numbers is:2 (11 and 13), also make sure the value of upper_limit should be greater than lower_limit].
Write a program to work like a calculator that perform the addition, subtraction, multiplication and division operation. Your program should use the function call method to call four sub functions to do the arithmetic operations. Example of output:
cout << sum(6,2) << end1 //will print 8
cout << subtract(6,2) << end1 //will print 4
cout << multiply(6,2) << end1 //will print 12
cout << divide(6,2) << end1 //will print 3
Write a program using function call to compare two integers and return the larger integer to the main program.
Utilize an array structure in conjunction to simulate our card deck.
Use the following array structures to assist in representing a card:
string face [13] = { "Ace ", "Deuce", "Three", "Four", "Five", "Six", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
string suit[4] = {"Hearts", "Diamonds", "Clubs", "Spade"};
Write a program that utilizes random number generation, just as you have in the past, to
generate a random face and random suit. This, of course, will be a “card”.
Use a loop to generate and print five cards.
Example Output:
Card 1: Five of Spades
Card 2: Queen of Hearts
Card 3: Seven of Spades
Card 4: Two of Clubs
Card 5: Ace of Diamonds
Accept two numbers and find their sum and difference. If the sum is more than the difference, display the sum otherwise display the difference
Explain default constructor and parameterized constructor with the help of program.
Explain with an example how one user defined data type can be converted to a predefined data type.
Write a program to perform binary operator overloading for a class named "data". The details of operators to be overloaded are:
+ will subtract the numbers
- will divide the numbers
*will add the numbers
/ will multiply the numbers.
Write a program to permanently store the data entered by the user. When user is done with Input, then print the confirmation message as "Content saved successfully" along with the number of character stored.