ِAssignment_2

advertisement
‫المملكة العربية السعودية‬
‫وزارة التعليم العالي‬
‫جامعة المجمعة‬
‫كلية علوم الحاسب وتقنية المعلومات‬
Kingdom of Saudi Arabia
Ministry of Higher Education
Majmaah University
Computer Science and Information Technology College
Assignment due by Thu Nov13 before 12:30 pm
Assignment 2

Write a complete C++ program that asks the user to enter numbers and add these numbers
until user enters: 0, then print the total sum of all numbers (you should use do..while loop).
Example of the output
Enter a number:5
Enter a number:3
Enter a number:0
The sum is: 8

Write a complete C++ program that asks the user to enter two numbers and enter an
operator (+ , - ,* , / ) then calculate the result depending on the entered operator.
(You should use switch).
Example of the output
Enter two numbers: 3 5
Enter an operator: *
The result is: 15
1
Download