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

Class & objects, how objects are initialized dynamically?

how objects are initialized dynamically?

C program for even & odd no in any matrices , C Program for EVEN & ODD NO I...

C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() {           int a[100][100];           int i=0,j=0,r,c,even=0,odd=0;

Develop an e commerce site, We need an E Commerce site likefifacointrader. ...

We need an E Commerce site likefifacointrader. you must have experience with that kind of work You have to show a sample of work like that site. Skills required are C Prog

Why can''t one open a file in a different directory , Why can't one open a ...

Why can't one open a file in a different directory like "..\test.dat"? A: Since " " is a tab character. You must employ forward slashes in your filenames, even on operating s

Vogels approximation transportation problem, Vogels approximation transport...

Vogels approximation transportation problem in c language source code

Explain looping statements, Looping Statements The statements usually u...

Looping Statements The statements usually used for looping are for, do-while, while. The goto statement can be used for looping, but its use is generally avoided as it leads to

Explain operator overloading, Explain Operator Overloading It is one ty...

Explain Operator Overloading It is one type of Polymorphism, an significant feature of object-oriented programming .Polymorphism means one thing having many forms, i.e. here an

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Visual basic, a program to accept average, if average is 75 to 85 print it...

a program to accept average, if average is 75 to 85 print it out else bypass using counter. enter and process 5 records

Expression and their types in cpp, E x p r e s sion and their types: ...

E x p r e s sion and their types: An expression will be in form of mathematical expression with C++ syntax embedded with it. Expressions are of following types which m

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