Answer to Question #285122 in C++ for Hassan Madu

Question #285122

Q1. Define a class Deposit that has a principal, a rate of interest, which is fixed for all




deposits and a period in terms of years. Write member functions to




(i) alter(float) which can change the rate of interest.




(ii) interest() which computes the interest and returns it.




(iii) print() which prints data as shown below. Note that the width of each column is 20.




5mks




Q2. Assume that the cell users are two kinds – those with a postpaid option and those




with a prepaid option. Postpaid gives a fixed free talk time and the rest is computed at




the rate of N2.90 per pulse. Prepaid cards have a fixed talk time.




Define a class Cell_user as a base class and derive the hierarchy of classes. Define




member functions and override them wherever necessary to




(i) retrieve the talk time left for each user.




(ii) print the bill in a proper format containing all the information for the postpaid user.




5mks







1
Expert's answer
2022-01-06T02:01:11-0500
#include <stdio.h>
int main()
 { float principle, rate, sinterest; int time;
 printf("Enter Principle Amount, Rate %% per Annum and Time\n");
 scanf ("%f %f %d", &principle, &rate, &time);

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog