Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write an inline function sum() with four parameters that calculates the

arguments

provided and returns their sum.

Parameters: Four variables of type long.

Returns: The sum of type long.

Use the default argument 0 to declare the last two parameter.



An automobile financier claims to be lending money at simple interest where the Principle and Year are the input and Rate of Interest is 12%. Write a C++ program to calculate it using default arguments.



Write a program to find the count of unique digits in a given number N. The number will be passed to the program as the input of type int.

Assumption: The input number will be a positive integer number>=1 and <= 25000.

For e.g.

If the given number is 292, the program should print 2 because there are only 2 unique digits "2" and "9" int this number.


Write a function Third_last_digit in C++ and call the function that print third last digit of the given number. The third last digit is being referred to the digit in the hundreds place in the given number.

For example, if the given number is 3197, the third last digit is 1.

Note 1 - The third last digit should be printed as a positive number. i.e. if the given number is -197, the third last digit is 1.

Note 2 - If the given number is a single-digit or double-digit number, then the third last digit does not exist. In such cases, the program should print -1. i.e. if the given number is 5, the third last digit should be print as -1.


Write a function Third_last_digit in C++ and call the function that print third last digit of the given number. The third last digit is being referred to the digit in the hundreds place in the given number.

For example, if the given number is 3197, the third last digit is 1.

Note 1 - The third last digit should be printed as a positive number. i.e. if the given number is -197, the third last digit is 1.

Note 2 - If the given number is a single-digit or double-digit number, then the third last digit does not exist. In such cases, the program should print -1. i.e. if the given number is 5, the third last digit should be print as -1.


Define a class Shape and include length,width attribute as protected and include member functions setwidth(int w) and setHeight(int h).Derive a class Rectangle and include calculate_Area() and display area of rectangle. Create an object Rect to store value of length and breadth from user and derive objects Area .


Create the class Complex that has floating point data members for storing real and imaginary parts and perform complex number addition. The class Complex has the following member functions: Complex() - Null constructor invokes when an object is created Complex(float, float) - Parameterized constructor to set the specified value of real and imaginary parts in object friend complex sum(complex, complex) - Friend function to perform complex number addition and return complex number display() - Function to display complex number object


Create a class called employee with the following details as variables within it.


1. Name of the employee


2. Age


3. Designation


4. Salary


Get the details of 5 employees and initialize it using Constructor. Release resources using destructor. print the name, designation and salary of employees, Find the highest salaried employee in professor grade and display their details.


create a class Customer with the following members:

Member variables: cid(integers) and cbalance (float).

Member functions:

Default(empty) constructor: It assigns cid and cbalance value as zero(0). Finally it print "Default Assignment".

Parameterized constructor: It receives two arguments and assign it to cid and cbalance.

void display(): This method display the values of cid and cbalance which are separated by a space.

Main method:

Implement the below code in main method and check your program output.

int main()

{

int cid;

float cbalance;

cin>>cid>>cbalance;

Customer obj1;

Customer obj2(cid,cbalance);

obj1.display();cout<<endl;

obj2.display();

return 0;

}


LATEST TUTORIALS
APPROVED BY CLIENTS