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

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 Note: (solve without vectors)


Discuss constructors with default arguments and constructor overloading with the help of suitable examples.

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]




Create a SavingsAccount class. Use a static data member annualInterestRate

to store the annual interest rate for each of the savers. Each member of the class

contains a private data member savingsBalance indicating the amount the saver

currently has on deposit. Provide member function calculateMonthlyInterest

that calculates the monthly interest by multiplying the balance by

annualInterestRate divided by 12; this interest should be added to

savingsBalance. Provide a static member function modifyInterestRate that sets

the static annualInterestRate to a new value. Write a driver program to test

class SavingsAccount. Instantiate two different objects of class SavingsAccount,

saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set

the annualInterestRate to 3 percent. Then calculate the monthly interest and

print the new balances for each of the savers. Then set the annualInterestRate to

4 percent, calculate the next month's interest and print the new balances for

each of the savers.


All values in an array must be of the same data type.


A: True

B: False


Observe the following code:

 

const int SIZE = 3;

int nums[SIZE] = {1, 2, 3};

for (int i = 0; i <= SIZE; i++) { 

  std::cout << nums[i];

}

 

What is wrong with this code?


A: You cannot use constants with array definitions

B: The initialization list exceeds the size of the array

C: Should be i = 1 because you need to start with the first array element

D: Should be i < SIZE so that you don't access an array element that doesn't exist


Observe the following code:

 

int nums[3] = {1, 2, 3};

std::cout << nums;

 

What will be output to the screen?


A: 1

B: 3

C: 123

D: A memory address


Create a machine problem implementing Object Oriented programming. Make it sure to apply that your program apply conditional structure, iterative structure and array .


Design a class Account that has the following member: Data Fields: account_id(int type), balance(double type)). Member Functions-> withdraw(),deposit(),getmonthly_interest() and parameterize constructor to initialize data members. Use this class to print the balance. Use the withdraw () to withdraw money less than Rs 5000 and then deposit more than or equal 1500 using deposit function. 


Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS