Concept explainers
(SavingsAccount Class) 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 calculateMonthlylnterest that calculates the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifylnterestRate that sets the static annualInterestRate to a new value. Write a driver
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
C How to Program (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Computer Science: An Overview (12th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Problem Solving with C++ (9th Edition)
- oop using c++ please give me full answer thanks Write a class Currency and makes the following attribute and member function. Currency name (String) Make a function name converter which converts the currency. Display function which display the value Make 3 derived classes name Dollar, euro and yen from Class Currency. In dollar class make a function converter and converts the minimum 50 dollars in rupees. In euro class make a function name converter which converts 1000 rupees into euro. User enter the amount less than 1000 display error message” invalid amount” Also create getter, setter and default constructor in above task.arrow_forwardprogramming language :c++ make a program in c++ to store hiring date and date of birth for Managers and Employees. You need to create a Date class for this purpose. Create objects of Date class in Manager and Employee classes to store respective dates. You need to write print function in Manager and Employee classes as well to print all information of Managers and Employees. You need to perform composition to implement this task. Create objects of Manager and Employee classes in main function and call print function for both objects. Print Date class here. Print updated Manager class here. Print updated Employee class here. Print main function here.arrow_forwardPythonarrow_forward
- Language=C++ Create an employee class. The member data should comprise an int for storing the employee number and a float for storing the employee’s compensation. Member functions should allow the user to enter this data and display it. Write a main() that allows the user to enter data for three employees and display it (Use Array of objects).arrow_forwardResearch assistants provide support to professionals who are conducting experiments or gathering andanalyzing information and data. Suppose you are working as RA (research assistant) with a Professor who isworking on a project and evaluating complex mathematical equations. Your duty is to assist him, so in thisregard he has assigned a task to you. Your task is to write a oop c++ program to create a class named equation which will have the data members a, b and c which are the coefficients of the quadratic equation. The class will have two more data members namely proot and nroot which stand for the positive root and negative root of the equation. Suppose that variables a, b and c are integers. Where proot and nroot are floats. Input Function to get values of a, b and c Then design a friend function which will determine the proot and nroot of the equation. Create another friend function which will display the values of proot and nroot.arrow_forwardReadme.md: Stars(C++) This lab exercise will practice creating objects with constructors and destructors and demonstrate when constructors and destructors are called. Star Class Create a class, Star. A Star object has two member variables: its name, and a solar radius. This class should have a constructor which takes a std::string, the name of the star, and a double, the solar radius of the star. In the constructor, the Star class should print to the terminal that the star was born. For example, if you create a Star as follows: Star my_star("Saiph", 22.2); Then the constructor should print: The star Saiph was born. In the destructor, the Star class should print to the terminal that the star was destroyed, along with the number of times the volume of the sun that that star was, formatted to two decimal places. Hint: use the following line to set the precision to 2 decimal places: std::cout << std::fixed << std::setprecision(2); For example, when my_star above has its…arrow_forward
- Book.cpp Main.cpparrow_forwardBank Accounts (Use Python) Write a program that accepts bank transactions and prints out the balance of an account afterwards. PROGRAM DESIGN Create a class named bankAccount. A bank account should have the following attributes: accNumber, balance, and dateOpened. This class should also have the option to do the following transactions: deposit, withdraw and drop. Initially there is only one bankAccount active in the program, with a balance amount of 1515, and was opened back in 10/01/1987. Depositing adds to a current bankAccount’s balance, while withdrawing – does otherwise. Dropping would equate the current balance to zero. Refer to the following class diagram for more details about the current bankAccount: bankAccountaccNumber = 1balance = 1515dateOpened = "10/27/1987" deposit(dep)withdraw(wd)drop(accNumber) INPUTThe input would be a string that contains the following data: the transaction to be done (dep – for deposit, wd – for withdraw and drop – for drop), the accNumber, and…arrow_forwardThis is an object oriented programming question The code should be in c++ language Create a class Employee having a private data members E_ID, E_Name, E_Age and E_Salary. Now create a public member function void getData() and void ShowData() to take and display an employee data. In the main(), function create an array of Employee class, size of the array should be taken from user at run time and call all the functions defined in the class. Sample Output: Enter details of Employee 1 Enter Employee Id: 101 Enter Employee Name: Usman Enter Employee Age: 29 Enter Employee Salary: 45000 Enter details of Employee 2 Enter Employee Id: 102 Enter Employee Name: Sana Enter Employee Age: 31 Enter Employee Salary: 51000 Enter details of Employee 3…arrow_forward
- c++ Friend function concepts Do not use operator overloading Create a class Circle with member variable radius R of type float. Create a constructor for assigning value to R and a method "int compare(Circle c)" for comparing the radii. In main method, create two objects of Circle and compare their radii and display which one is biggerarrow_forwardLanguage : C++ Subject : OOP Suppose we have a class Rectangle which has two data members, length and width. In addition, there should be a static variable, namely allRectanglesTotalArea which stores the area of all the Rectangles created. Furthermore, there should be a function named calcRectangleArea() which calculates the area of rectangle and adds it to the allRectanglesTotalArea. Write a static function nameddisplayAllRectanglesTotalArea()which displays the value of allRectanglesTotalArea. The main function of the program should look like the following. intmain() { Rectangle r1(5.0,4.0); r1.calcRectangleArea(); Rectangle r2(2.5,4.0); r2.calcRectangleArea(); Rectangle::displayAllRectanglesTotalArea(); return 0; }arrow_forward(After reading the instructions given in the pictures attached, read the following) Class membersdoctorType Class must contain at least these functionsdoctorType(string first, string last, string spl); //First Name, Last Name, Specialty void print() const; //Formatted Display First Name, Last Name, Specialtyvoid setSpeciality(string); //Set the doctor’s Specialtystring getSpeciality(); //Return the doctor’s SpecialtypatientType Class must contain at least these functionsvoid setInfo(string id, string fName, string lName,int bDay, int bMth, int bYear,string docFrName, string docLaName, string docSpl,int admDay, int admMth, int admYear,int disChDay, int disChMth, int disChYear);void setID(string);string getID();void setBirthDate(int dy, int mo, int yr);int getBirthDay();int getBirthMonth();int getBirthYear();void setDoctorName(string fName, string lName);void setDoctorSpl(string);string getDoctorFName();string getDoctorLName();string getDoctorSpl();void…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning