Module 1 Lab - Operator - Challenge Lab
Objective
In this lab, you will create a C++ program that prompts the user to enter two numbers. The program will perform various operations using these numbers, such as addition, subtraction, multiplication, division, and modulus. It will display the results of these operations to the user.
Requirements
Task 1: User Input
Prompt the user to enter the first number.
Prompt the user to enter the second number.
Task 2: Arithmetic Operations
Perform the following operations using the entered numbers:
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Modulus (%)
Task 3: Display Results
Display the entered numbers and the results of the arithmetic operations in a well-formatted manner.
Lab Instructions:
Declare the required variables to store the two numbers entered by the user.
Prompt the user to enter the first number using an appropriate input statement.
Prompt the user to enter the second number using another input statement.
Perform the addition operation using the '+' operator and store the result in a variable.
Perform the subtraction operation using the '-' operator and store the result in a variable.
Perform the multiplication operation using the '*' operator and store the result in a variable.
Perform the division operation using the '/' operator and store the result in a variable.
Perform the modulus operation using the '%' operator and store the result in a variable.
Use appropriate output statements to display the entered numbers and the results of the arithmetic operations in a well-formatted manner.
Deliverable
Upload the following:
Full source code (.txt or .cpp)
Screenshot of the Console with the code executing
COSC-1336 / ITSE-1302 Computer Science - Author: Dr. Kevin Roark