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

Raising a number n to a power p is the same as multiplying n by itself p times. Write a function called power() that takes a double value for n and an int value for p, and returns the result as a double value. Use a default argument of 2 for p, so that if this argument is omitted, the number n will be squared. Write a main() function that gets values from the user to test this function.


To creat this C++ programme create a structure containing patient information like patient id, name of patient, disease description, doctor name and flag to know whether patient has an appointment (Stucture array of 5)

You have to

1. Add a new patient

2. Display patients that have appointment

3. Display all patients in the hospital of a particular doctor

4. Display all the patients that have appointment with a specific doctor

5. Display the total number of patients in the hospital

6. Book a appointment

(If we book an appointment, the total number of appointments increased by 1)


Create a class named Random Program and add a static function named reverse that will accept integer e.g. 17425 and return the reverse (52471


teacher student data management system with classes project


(a) What is the purpose of the keywords public and private in the class declaration? (b) What is the difference between a class and an object? (c) What does it mean to ‘instantiate’ an object? (d) What is the purpose of a constructor? (e) What is the difference between the default constructor and the overloaded constructor? (f) What is the purpose of a destructor? (g) What is the purpose of an accessor? (h) What is the purpose of a mutator? (i) What is the purpose of the scope resolution operator? (j) What is the difference between the scope resolution operator and the dot operator? (k) What is the difference between a member function and an ordinary function? (l) What is an abstract data type (ADT)? (m) How do we create an ADT? (n) What are the advantages of using ADTs? (o) What is separate compilation? (p) What are the advantages of separate compilation? (q) What is a derived class? (r) What is the purpose of inheritance? 


Consider the following structure used to keep record of a module: struct Module { string moduleName; string moduleCode; string lecturer; int nrStudents; } Turn the Module struct into a class. The class should have member variables for all the values in the corresponding struct. Make all the member variables private. Include public member functions for each of the following: a default constructor that sets the string member variables to blank strings, and the int member variable to 0 overloaded constructor that sets the member variables to specified values;  member functions to set each of the member variables to a value given as an argument to the function member functions to retrieve the data from each of the member variables Test the class in a program that instantiates an object of class Module. The program should then input values for the object and use the mutators to assign values to the member variables. Use the accessors to obtain the values


Write a program that uses a function to display all the numbers divisible by 3 between 0 and 100.


• Create a C++ program using Fibonacci sequence is a numerical sequence such that after the second element all numbers are equal to the sum of the previous two elements.


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...


Write a program to calculate and print the first 20 elements of this sequence. Use a 20-element array to perform this task.  




Create a program that will create 2X3x3 dimensional array. This program will enable the user to input 3 scores of student1, student2 and student3 for every plane, then will enable to display the average score of each student in the plane.

average my vary depending on the scores inputted by the user


Due to upcoming end of financial year, you are being called in to write a program which will read in an input file called IncomeRec.txt, whichcontains a list of Annual(Gross)incomerecordsof employees in a firm,and produce various reports as outlined and You must read this input file(IncomeRec.txt)and store the records ofgrossincomesinto appropriate arrays. 2.Your program should then be able to process the following commands. i.e. programshould provide user with the following menu.▪1. Print the entire list.▪2. Print list sorted byGross income.▪3. Print list ofemployees which match a given lastname initial▪4. Calculate:a)the Taxcorresponding to the provided grossincomeof each employeeusing Table 1;and b)the Net Incomeand c)Print in a filecalled IncomeTax.txtwhere the tax and Net income are displayed in separatecolumns.[NB. The tax is calculatedaccording to the Tax Calculation Table provided and the Net Income =Gross income–Tax]▪5. Exit program


LATEST TUTORIALS
APPROVED BY CLIENTS