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



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. Hi,

I am using this code and gettin

View Tutorial          By: Akanksha at 2014-01-20 10:31:31

2. Do the serialized output is displayed in the file
View Tutorial          By: Atihs at 2012-11-17 02:38:52

3. Thank you Sir.
View Tutorial          By: Dinesh at 2015-08-25 10:41:30

4. Its informative and helpful. Thanx
View Tutorial          By: Usama at 2012-07-14 22:16:45

5. The Compleate Reference
JAVA Seventh Editi

View Tutorial          By: joshap at 2014-10-25 12:05:41

6. Very helpful stuff. Might I just add that you didn
View Tutorial          By: Donovan Aces at 2011-09-12 06:08:20

7. Great!!!!!!!!!!!!!!!!!!!!
View Tutorial          By: Raghbendra Nayak at 2012-03-28 12:54:35

8. Thanks a lot .. Great work!!
View Tutorial          By: MonamAlwerfally at 2013-03-26 14:41:29

9. I want to using swith with string...
How to

View Tutorial          By: anuj at 2015-03-04 18:22:29

10. how to read a number from a keyboard and write tha
View Tutorial          By: aiswarya at 2015-09-13 03:48:05