Question
How is the null character represented in C++? Identify and describe two common errors that are easy to make when manipulating arrays. What are the
How is the null character represented in C++?
Identify and describe two common errors that are easy to make when manipulating arrays.
What are the disadvantages of using global variables instead of local variables?
Create a class called "Savings". This class has three attributes, all private,
- string alias
- double interest
- both of the above are created upon instancing
- double balance, starts at 0.00
The methods are
- a constructor
- a privatecalcInterest()
- adds to the current balance the product of the balance * interest
- replaces balance
- a public alias(string) function
- changes the alias to a new string passed as a parameter
- does not allow empty string
- a publicdeposit(double) function
- passes an argument which adds to the current balance
- then calls calcInterest()
- a public display() function
- displays info describing the object
The main() should have:
Savings savings("college", 0.05);
savings .alias("car");
savings .deposit(5000);
savings.display();
This should produce the output:
The savings called car has $5250.0
____________________ are variables that can hold memory addresses.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started