In this exercise, learners/lecturers will write simple C++ programs that accept user input and then output responses to the command line. Learners will then test their programs by pushing them to their GitHub repo and checking the output from automated tests.
-
Using the
HelloWorld.cpp
file, create a program that outputs "Hello World!". -
Push your changes back to your assignment GitHub repo. Remember to try to make your commits atomic and your commit messages descriptive.
-
Wait a minute for the tests to run. Refresh the repo page to see if you have completed the exercise successfully. You should score 10 marks if the test passes.
-
Using the
YourName.cpp
file, create a program that asks the user for their name. -
The program should then output the text
"Your name is "
followed by the user's name. -
Push your changes back to your assignment GitHub repo. Remember to try to make your commits atomic and your commit messages descriptive.
-
Wait a minute for the tests to run. Refresh the repo page to see if you have completed the exercise successfully. You should score 10 marks if the test passes.
-
Using the
Sum.cpp
file, create a program that asks the user to enter 2 integers. -
The program should then output the sum of the 2 numbers.
-
Push your changes back to your assignment GitHub repo. Remember to try to make your commits atomic and your commit messages descriptive.
-
Wait a minute for the tests to run. Refresh the repo page to see if you have completed the exercise successfully. You should score 10 marks if the test passes.