Question: C++ please 2. (Merge two sorted lists) Write the following method that merges two sorted lists into a new sorted list. void merge (const int

 C++ please 2. (Merge two sorted lists) Write the following methodC++ please

2. (Merge two sorted lists) Write the following method that merges two sorted lists into a new sorted list. void merge (const int listi], int sizel, const int list2, int size2, int 1ist3]) Implement the method in a way that takes at most sizesize2 comparisons. Write a test program that prompts the user to enter two sorted lists and displays the merged list. Here is a sample run. Note that the first number (number in red) in the input indicates the number of the elements in the list. This number is not part of the list Enter 1istl: 51 5 16 61 111 Enter 1ist2: 4 2 4 5 6 The merged list is 1 2 4 5 5 6 16 61 111 3. (The Account class) Design a class named Account that contains A private int data field named id for the account (default 0) A private double data field named balance for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate A no-arg constructor that creates a default account. A constructor that creates an account with the specified id and initial balance The accessor and mutator methods for id, balance, and annualInterestRate The accessor method for dateCreated A method named getMonthlyInterestRate0 that returns the monthly interest rate A method named getMonthlyInterest) that returns the monthly interest. A method named withdraw that withdraws a specified amount from the account A method named deposit that deposits a specified amount to the account. Draw the UML diagram for the class and then implement the class. (Hint: The method getMonthlyInterest() is to return monthly interest, not the interest rate Monthly interest is balance monthlyInterestRate. monthlyInterestRate is annualInterestRate12. Note that annualInterestRate is a percentage, eg, like 45%. You need to divide it by 100) Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual i terest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit S3,000, and print the balance, the monthly interest, and the date when this account was created

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!