Write a class C2 that inherits all the functionality of A2 and B2,
// with the same stipulation that it should take f() from A2 and g() from B2.
Write a class named "BankAccount" with the following attributes: id, currency and balance. The class has a constructor with only two of the attributes: id and currency. The value of the currency, if omitted, has a default value "EUR0". The third attribute by default is zero. We suppose that when we activate a bank account its balance is initially empty.
Task 2:
Write a Python class named "Calculator" that has no attributes.The class has only one method named "performOperation()" that takes in input three parameters, two numeric values (A and B) and one string value representing one of the four basic mathematical operations (+","", "*" or "/"). For each operation, it returns the result of the respective operation for the two numbers. In case the second value is zero and the operation is "/", the method returns a string message "Error: Can not divide by zero". If the operation is not as expected, the method returns a string message "Error: Operation not supported".
Write a Python class named "Pencil" that has three attributes: brand (string), color (string), thickness (int).
The class must include a constructor method that initializes each variable to an appropriate value, and the class should include methods for setting the value of each type and retrieving the value of each type.
The table given below shows the list of gases, liquids and solids. By entering the substances, find the state of the material. Implement the above logic through C++.
S.No.
Materials
1
Water
2
Oxygen
3
Gold
4
Ice
5
Petrol
Create a class called employee that contains a name (an object of class string) and an employee number (type long). Include a member function called getdata() to get data from the user for insertion into the object, and another function called putdata()to display the data. Assume the name has no embedded blanks.
Write a main()program to exercise this class
Trekking Kit
Given an object
trekkingKit in the prefilled code and item item as an input, write a JS program to add the method isKitContains to the constructor function Trekking using the prototype.
The method
isKitContains checks whether the trekkingKit contains the given item.
Quick Tip
The Object.getOwnPropertyNames() method gives an array containing the properties of the object.
Input
The input will be a single line containing a string
item
Output
The output should be a single line containing a boolean value
Sample Input 1
ruckSackBag
Sample Output 1
true
Sample Input 2
surfboard
Sample Output 2
false
Hotel Bill
A Hotel is offering discounts to its customers.
Given charge per day
dayCharge based on category and numbers of days customer stayed days as inputs, write a JS arrow function to return the total bill with the discount.
Quick Tip
Apply discounts on the following basis,
Sample Input 1
200
3
Sample Output 1
570
Sample Input 2
180
1
Sample Output 2
180
Sample Input 2
400
6
Sample Output 2
2040
write c++ program find factorial number input
Write a short note on the following graphic formats and state one (one) example under each? i. Vector graphics ii. Raster graphics b) What is the difference between Multimedia Software and Multimedia Hardware? c) State the difference between the following and state any two (2) examples under each? i. Lossless and lossy ii. Symmetrical and asymmetrical