Questions: 11 448

Answers by our Experts: 10 707

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

Create a function named DisplayNumberText to Display Number and Text input by user
Write a C++ program that calculates GCD of given number using function with returning by reference

Can you do this one?Write a statement that assigns finalValue with the division of userNum1 by userNum2. Ex: If userNum1 is 6 and userNum2 is 2, finalValue is 3. I Dion't know what I'm doing wrong!


Write a programme for displaying a school with different labs and their equipment’s and their prices


Write a C++ program that asks the user to store the basic salaries of 50 employees in a 1-D array called Salaries and their overtime hours in a 1-D array called OvertimeHours (5 points). Each employee will be paid $30 for each overtime hour. The program should call a functions to do each of the following:

 

·       Store in an array called finalSalaries the final salaries of the 50 employees. An employee’s final salary is computed as the sum of the basic salary and the earned overtime payments. Also note that a 4% income tax is deducted from the computed final salary. (5 points).

·       Output an ascending sorted list of the employees’ final salaries. (5 points).

·       Increase by 2% the basic salaries of the employees who worked for more than 10 overtime hours. (5 points).



Write a C++ program to calculate the total marks of each student of a class. This class takes the

following subjects Physics, Chemistry and Mathematics. Your program shall be able to calculate the

total marks for each student, this is the sum of marks from the three subjects


Q3.Create a bookstore in the following manner: 10
• Add books in a bookstore using a member function, count and display the number of books in a bookstore
Define a class named COMPLEX for representing complex numbers that contains necessary data members and member functions. A complex number has the general form a + ib, where a is the real part and b is the imaginary part (i stands for imaginary). Include methods for all the four

basic arithmetic operators.
Consider the class definition below and answer the questions that follow:

class InsurancePolicy
{
public:
InsurancePolicy();
InsurancePolicy(int pNr, string pHolder, double aRate);
~InsurancePolicy();
void setPolicy(int pNr, string pHolder, double aRate);
int get_pNr()const;
string get_pHolder()const;
double get_aRate()const;
private:
int policyNr;
string policyHolder;
double annualRate;
};

(d) Add a member function
void showPolicy(ostream & out)const;
to the class InsurancePolicy as well as to the class CarInsurance in order
to display the member variables of InsurancePolicy and CarInsurance.
Consider the class definition below and answer the questions that follow:

class InsurancePolicy
{
public:
InsurancePolicy();
InsurancePolicy(int pNr, string pHolder, double aRate);
~InsurancePolicy();
void setPolicy(int pNr, string pHolder, double aRate);
int get_pNr()const;
string get_pHolder()const;
double get_aRate()const;
private:
int policyNr;
string policyHolder;
double annualRate;
};

(c) Implement the class CarInsurance and use the code below to implement
setPolicy():
void CarInsurance:: setPolicy(int pNr, string pHolder,
double aRate, double
eValue)
{
policyNr = pNr;
policyholder = pHolder;
annualRate = aRate;
excess = eValue;
}
You should obtain the following errors:
Explain why setPolicy()is not a legal definition in the derived class
CarInsurance?
Suggest two ways to fix this problem.
LATEST TUTORIALS
APPROVED BY CLIENTS