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. it should be:
/* --------------- */

View Tutorial          By: Ryba at 2010-05-19 15:45:48

2. So I appreciate this website, however... would it
View Tutorial          By: Christina at 2013-02-06 16:46:12

3. Thanks for this tip -
I'm currently workin

View Tutorial          By: Helen at 2009-06-16 05:28:24

4. hello
thanks for your code. Please could an

View Tutorial          By: Bruno at 2009-05-28 15:38:46

5. Gracias. Ya me estaba poniendo nervioso. No pod&ia
View Tutorial          By: Manuel at 2015-07-30 11:34:54

6. gooooooodddddddd
View Tutorial          By: arya tandon at 2015-02-23 09:08:05

7. i have completed B.Tech,i want to SCJP exam ,tell
View Tutorial          By: bmnaidu at 2013-04-12 16:56:48

8. Hi puru, The syntax is substring(int startIndex, i
View Tutorial          By: Fazal at 2008-09-12 20:17:53

9. Great tutorial. THX.
View Tutorial          By: Velvetin at 2009-03-21 11:05:19

10. Write a program to input the number and use switch
View Tutorial          By: abdulaziz at 2014-03-28 16:22:35