CS 3005: Programming in C++
Hello, world!
Introduction
You need to setup your development environment to complete work in this course.
This assignment will require you to install the build tools for C++, an appropriate editor, git
, and make
.
You will also be required to create a GitHub
account, use it to join the GitHub Classroom
for this course, and checkout your GitHub
repository.
Assignment
Create a “Hello, world!” program in C++. This function’s console output must be “Hello, world!” followed by a newline character. It must also have an exit status of 0
(zero).
Programming Requirements
Create program-hello/hello.cpp
Functions
int main();
Sends the messageHello, world!
to the standard output stream; Returns value0
(zero).
Create program-hello/Makefile
This file must contain rules such that any of the following commands will build the hello
program:
make
make all
make hello
Create program-hello/.gitignore
The file program-hello/.gitignore
needs to store one line of text:
hello
This will prevent the executable program hello
from being committed to the repository.
It is a derived file.
Create Makefile
Create a project-level Makefile so that running make
or make all
(all
should be the default target) in the project directory will call make
in the program-hello
directory.
The command to call a different Makefile within make
is make -C {NEW_DIRECTORY} {TARGET}
. Since you will create your program-hello
Makefile to build the program as the default target, we do not need to specify a target here.
Thus your command in your project-level Makefile can be make -C program-hello
. This should be called under the default all
target.
Additional Documentation
Grading Instructions
To receive credit for this assignment:
- your code must be pushed to your repository for this class on GitHub
- all acceptance tests must pass
- all programs must build, run, and execute as described in the assignment descriptions.
Extra Challenges (Not Required)
- Create an additional program
cs3005
that displays the message “Hello, CS 3005!”. - Create an additional program
roses
that displays the words to “Ring around the rosie”. - Make your program write
Hello, world!
in green. Test this against the unit tests. Does it still pass? Why or why not?- List of Ansi color escape sequences
- Type
man reset
to learn about thereset
command to reset your terminal if it has gotten into a bad state from control codes.
Last Updated 08/22/2024