Questions: 9 913

Answers by our Experts: 9 913

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 a function in C++ to calculate and return the roots of a quadratic equation ax2 + bx + c = 0. 

Return x1 and x2 through

parameter of the function. The prototype of this function is defined by:

void solveEquation(int a, int b, int c, float *x1, float *x2);


Write a function in C++ program to exchange two numbers. 

These two variables are passed through parameters of the

function using pointer. void exchange(int *a, int *b)


Print a welcome message to the screen as follows:




We bid welcome to the ladies of Beauxbaton and our friends from the north, the sons of Durmstrang.

Your task is to implement this:


• A member variable that will hold the annual interest rate of the loan. Its default value will be 2.5.



• A member variable that will hold the number of years for the loan. Its default value will be 1.




• A member variable that will hold the loan amount. Its default variable will be 1000.




• A default constructor.




• Another constructor that has interest rate, years, and loan amount as its parameters.




• A member function that returns the annual interest rate of this loan.




• A member function that returns the number of the years of this loan.




• A member function that returns the amount of this loan.



• A member function that returns the monthly payment of this loan.



• A member function that returns the total payment of this loan.



Enter yearly interest rate, for example 8.25: 10





Enter number of years as an integer, for example 5: 5





Enter loan amount, for example 120000.95: 300000





The monthly payment is 6374.11





The total payment is 382446.80

write a programme that represent the object computer which has features such as Memory, storage, speed and brand. suggest at least one method in addition to to the constructor


Write a program that uses a structure to store the following data about a customer account:


· Name


· Address


· City


 · Telephone Number


 · Account Balance


With a function of withdrawMoney( float amountwithdraw) and depositMoney(float amountdeposit).



Implement a structure of car having car model, plate number, location, isParked (boolean type).

Car can move and park.


Move(): This function may update the location of car as it is moved.

Park(): This function added car details in the system and update is parked status.


 Your program will also tell the parking managemt about the status of parking using isParked().

IsParked() : This function can find a car is it parked on not?


Write a class named

Student that has the following member variables:

• name. A string that holds the student ’s name.

• ID Number. An int variable that holds the student ’s ID number.

• major. A string that holds the name of the major of the student.

• Grade. A string that holds the student ’s grade.

The class should have the following member functions:

• get (): A member function that defined outside of the class, accepts the following values as arguments and assigns them to the appropriate member variables: student’s name, student’s ID number, major, and grade.

• put (): A member function that defined in side the class and display all the values as an output.

Write a C++ program that creates one object of Student class to hold the following data.

Name: Susan Meyers

ID Number: 47899

Major: MIS

Grade: A






The manager of the company has informed his assistant to enter the age

of all the workers working in production department. Among all he has to

find the employee with maximum age employee. Help the manager with

c++ program based on the concept of object oriented programming by

creating a class employee having members empid, empname, edept,eage

and display the name ,dept. and salary employee whose age is maximum.

Store the date of at least 7 employees. Make the data members of class

only public .

Constraints

Employee age should greater than 22 if constraints are not matched then

display "wrong age input


Look at the following code and identify what is wrong with it:

 

void multiply(int, int);

 

int main() {

  std::cout << "The answer is: " << multiply(num1, num2);

}

 

void multiply(int a, int b) {

  return a * b;

}

 

Prototype is missing variable names

Int parameters should be doubles

Void functions cannot return a value

Value-returning functions must be called in a statement that stores the returned value in a variable


LATEST TUTORIALS
APPROVED BY CLIENTS