Comment on Tutorial - Using switch Statements in C++ By Emiley J



Comment Added by : basil

Comment Added at : 2011-08-04 13:00:30

Comment on Tutorial : Using switch Statements in C++ By Emiley J
3. Write a program that will continuously ask for an integer input from the user until a negative
value is entered. Display the sum and the average of the numbers entered (not including the
negative sentinel value). (Filename: Filename: Exer6.cpp)
Example output:
Please enter number 1? 10
Please enter number 2? 8
Please enter number 3? 3
Please enter number 3? -1
Average is 7.
Computer for sum and average again [Y/N]? N
Goodbye.


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Sir,
i am implementing the above code in w

View Tutorial          By: Rahul Singh at 2009-09-01 04:23:25

2. Thank you
View Tutorial          By: vbulletincoder at 2011-09-13 13:16:40

3. i have json data like coffeename and coffee prize
View Tutorial          By: Paramatma sharan upadhyay at 2015-09-21 12:14:31

4. excellent
View Tutorial          By: alok mishra at 2008-05-12 00:51:57

5. u said that const function cant change object.can
View Tutorial          By: z at 2010-05-09 12:02:17

6. Just what I needed. Thank you.
View Tutorial          By: Clive Jefferies at 2009-06-01 08:05:15

7. I need JSP Code to send SMS to mobile.
View Tutorial          By: nana at 2010-03-12 22:43:22

8. thanks....good explanation...
View Tutorial          By: jiby at 2012-01-14 05:57:33

9. Of course you can use this in a web application. A
View Tutorial          By: Ramlak at 2008-09-17 08:24:21

10. Very Great thanks for the code
View Tutorial          By: Alvin Funelas at 2014-07-12 00:42:01