Description
1. Write a C++ (or Java) program called hw0_1.cpp (or hw0_1.java) that reads two integer numbers from
a user and displays the sum and difference of the two numbers on the screen.
Sample Run 0: This is a sample run of the program. The bold font is used to indicate the user’s input.
Note that your program has to display the output exactly like the sample run. Also, the difference of
two numbers always zero or positive number.
9 -10
SUM:-1
DIFF:19
Sample Run 1: This is another sample run.
12 5
SUM:17
DIFF:7
Sample Run 2: This is the last sample run.
-7 -7
SUM:-14
DIFF:0
CST370 Page 1 of 3 Homework 0
2. Write a C++ (or Java) program called hw0_2.cpp (or hw0_2.java) that reads five integer numbers
from a user and displays the min, max, and median values on the screen.
Sample Run 0: This is a sample run of the program.
1 3 5 4 2
MIN:1
MAX:5
MEDIAN:3
Sample Run 1: This is another sample run.
-2 -300 75 24 2
MIN:-300
MAX:75
MEDIAN:2
Sample Run 2: This is the last sample run.
5 2 5 3 2
MIN:2
MAX:5
MEDIAN:3
=====================================================================
Programming Steps for Homework Submission
The following is the instructor’s recommendation for the homework programming.
Step 1: Read the homework description carefully
Before starting the programming, you should identify what the instructor wants. To get the requirement of
the programming, read the homework description very carefully before starting the development.
Step 2: Develop the program at AWS Educate Cloud9
After understanding the requirement clearly, go to https://www.awseducate.com/signin and start
development.
Step 3: Test your program
While developing your program, test it using the sample runs provided in the homework description. You
also need to run your own input data to make sure that your program works well for other input data
which are not presented in the homework description.
CST370 Page 2 of 3 Homework 0
Step 4: Run the automatic script
Run the automatic script of test cases provided by the instructor because the instructor and TA will use
the script for the grading purpose. For details, read the power point file named
“AWS_Educate_for_Homework.ppt” on Canvas.
Step 5: Submit your programs on Canvas
When you finish your development and testing, submit your source code on Canvas. In the source code,
you have to include the head comment such as “Title”, “Abstract”, “ID”, “Name”, and “Date”.
The following is a sample C++ program with the head comment.
/*
* Title: hw0_1.cpp
* Abstract: This program reads two integer numbers from a user and
* displays the sum and difference of them.
* Author: Bob Otter
* ID: 8899
* Date: 10/24/2021
*/
#include
using namespace std;
int main()
{
// Your actual code will be here…
return 0;
}
CST370 Page 3 of 3 Homework 0