WAP that create a class for representing a complex variable consisting the following information
1. Two instance hidden variable real and imaginary.
2. Two constructor’s i.e 1 default and other 2 augmented constructor.
3. Two get methods for accessing the values of instance variable.
4. Add methods that returns (object) the addition of two complex object.
5. Add methods that returns (object) the subtraction of two complex object.
6. Add methods that returns (object) the multiply of two complex object.
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways.
Write a program that takes a string and an integer as input, and outputs a sentence using the input values as shown in the example below. The program repeats until the input string is quit and disregards the integer input that follows.
Ex: If the input is:
apples 5
shoes 2
quit 0
the output is:
Eating 5 apples a day keeps you happy and healthy.
Eating 2 shoes a day keeps you happy and healthy
Write a program to overload operators in the same program by writing suitable operator member functions for following expression:
O7= ((O1 % O2)>(O3 || O4) - (O5>O6)) [Here O1,O2,O3,O4,O5,O6 and O7 are objects of a class “overloading”, and this class is having one integer data member]
: Write a program to take input for n number of doctor records and write records of all cardiologists in a file named: “record1”. Also write records of all those doctors in another file named: “record2” who are taking salary more than INR 80,000. After writing records in both files, merge their contents in another file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of doctor: doc_id, doc_name, doc_specialization, doc_salary]
[int(input()) for _ in range(n)]
in this line how we are using for loop aside of input() function can you explain
in this answer why we are using "_" operator and what is the use with it
Write a program to overload binary + operator using friend function to add values entered in kilo meters and meters and to overload binary – operator using member function to subtract values entered in kilograms and grams
Write a python program to count number of each characters in a string
For example python
P=1,y=1,t=1,h=1,o=1,n=1
Write a program to overload operators in the same program by writing suitable operator member functions for following expression:
07= ((01 % 02)>(03 || 04) - (05>06)) [Here 01,02,03,04,05,06 and 07 are objects of a class "overloading", and this class is having one integer data member]
Write a program to overload operators in the same program by writing suitable operator member functions for following expression:
O7= ((O1 % O2)>(O3 || O4) - (O5>O6)) [Here O1,O2,O3,O4,O5,O6 and O7 are objects of a class “overloading”, and this class is having one integer data member]