Objective: The purpose of this activity is to help the student to use relational and logical operators in mathematical operations and to solve simple programming problems that require the use of relational and logical operators. (Objectives 1 and 2) Student Instructions: 1. Modify the following program so that the user enters two values to test if they are equal. It must offer a message for equal values and another for different values. Make sure you print an address (prompt) for each input. Test the program with pairs of equal and different values. 2. Submit your archiveoff.cpp" by Assignment, you will have one attempt to submit the activity successfully. 3. The value of the activity is 10 points. 4. The deadline for answering the questions can be found in 'Tools' which is found in "Calendar" within the Blackboard platform.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question

Objective: The purpose of this activity is to help the student to use relational and logical operators in mathematical operations and to solve simple programming problems that require the use of relational and logical operators. (Objectives 1 and 2)
Student Instructions:
1. Modify the following program so that the user enters two values to test if they are equal. It must offer a message for equal values and another for different values. Make sure you print an address (prompt) for each input. Test the program with pairs of equal and different values. 2. Submit your archiveoff.cpp" by Assignment, you will have one attempt to submit the activity successfully. 3. The value of the activity is 10 points. 4. The deadline for answering the questions can be found in 'Tools' which is found in "Calendar" within the Blackboard platform.

#include <iostream>
using namespace std;
int main()
{
}
int num1,
num2;
cout << "Please enter an integer" << endl;
cin >> num1;
// num1 is not initialized
// num2 has been initialized to 5
H
cout << "num1 = " << num1 <<" and num2= << num2 << endl;
if (num1 = num2)
return 0;
cout << "Hey, that's a coincidence!" << endl;
Transcribed Image Text:#include <iostream> using namespace std; int main() { } int num1, num2; cout << "Please enter an integer" << endl; cin >> num1; // num1 is not initialized // num2 has been initialized to 5 H cout << "num1 = " << num1 <<" and num2= << num2 << endl; if (num1 = num2) return 0; cout << "Hey, that's a coincidence!" << endl;
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT