The use of the break and continue statements in a loop, C/C++ Programming

Assignment Help:

Question:

(a) A bank has four types of accounts with annual interest rates as follows:

Savings 8%
Savings with Cheque Book 5%
Current 4%
Fixed deposits 10%

Using the switch statement, write a C++ program that allows a user to input the current balance of an account and the type of account and displays the total interest obtainable.

(b) Loops allow program statements to be repeated either using counter controlled or sentinel controlled. Explain these two terms.

(c) Explain the use of the Break and Continue statements in a loop.

(d) Following a laboratory experiment, an engineering student needs to measure and input a certain number of voltage values of a circuit of n components in series.

Write a C++ program to allow the student to make the above entries and hence calculate the total voltage of the circuit.

Note that the program should ask the student if he/she wants to continue. If he/she answers „y? or „Y? the user will be allowed to enter a new value for n followed by n new values. If he/she answers „n? or „N?, the program should exit. However, if the student does not answer by y/Y or n/N, the program should ignore the answer and prompt him/her to re-enter the answer.


Related Discussions:- The use of the break and continue statements in a loop

Bankers algorithm, creating a system having five process from p0 to p4 and ...

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.

How does free know the size of memory to be deleted.?, How does free know t...

How does free know the size of memory to be deleted.? int *i = (int *)malloc(12); followed by free(i); how did free function call know how much of memory to delete? A: It bas

Data structure, how to convert a general tree into binary tree with example...

how to convert a general tree into binary tree with example

#titlethe Average Temperature in Paradise.., Writing and compiling a progra...

Writing and compiling a program from a given Use Case definition. Follow the Average Temperature in Paradise

Algorithm, What is an algorithm and write an algorithm to calculate the sim...

What is an algorithm and write an algorithm to calculate the simple interest

Pointers, When declaring a variable of data type pointer, use the * in fron...

When declaring a variable of data type pointer, use the * in front of the variable name. These variables hold a memory location (like B45CDF), not an actual value like 30 or A:

Programing solution, write a program that declares and initializes 2 intege...

write a program that declares and initializes 2 integer variable a and b with the value 35 and 14, and displays and calculates their sum,product,quotient and real division result.t

Big M method, I Want a answer for solving the big M method in the topic of ...

I Want a answer for solving the big M method in the topic of simplex method...

Is it possible to pass an entire structure to functions, Is it possible to ...

Is it possible to pass an entire structure to functions? Yes, it's possible to pass an entire structure to a function in a call by method style. Some programmers prefer to decl

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd