Pre-Flight: Playground & Question System
* Not all activities on this page are graded. If the activity is not graded, it will be specified as such. It is to your advantage to complete all activities.
Welcome
Activity Interface
This semester we are deploying our "playground" infrastructure for the in-browser compilation, execution, and grading of code written in the C++ programming language.
The activity interface is something you'll see very often: it will usually be attached to the lesson pages so that you can see and apply what you've just learned in action. Carefully read the instructions, complete this activity, and get a feel for our interface. The following activity is the only activity on this page with tabs, so play around with that too. Try rearranging them for no reason.
Activity: Hello To You Too
Ungraded Playground
There are something called functions in C++. You are probably familiar with what it is. You'll learn more about it in the coming week, but for now, all you need to know to get started on this is:
- In
utilities.h
, we told the compiler that we are going to have a function calledHelloName
that takes one argument, a string, and also returns a string. This is calleddeclaration . Now compiler expects to be fed the directives of what this function should do. - In
utilities.cpp
, we have now fed the compiler the directives of what this function does. You don't need to worry about what's in there for now. This is calleddefinition . driver.cpp
is the file we are interested in right now. This contains amain
function. This function is very important because this is called at the startup of the program and is necessary for a program to run1.
If you didn't understand what these mean, that's okay. All you have to do is to edit the argument that's being passed onto HelloName
in driver.cpp
, and observe what happens! Play around until you are familiar with our interface.
-
"A program shall contain a global function named main, which is the designated start of the program." is the exact quote from the C++ language standards. ↩
Graded activities
Almost all the programming exercises you encounter will contribute to your final grade: those with the yellow "Graded" tag contribute as such. Notice the last activity was an exception; the subsequent will be the norm. You will have an unmetered number of attempts on the programming exercises. Despite the following activity being graded, feel free to tinker with it. Your highest score will be recorded in the grade book, so do not fear getting the problem wrong initially.
Activity: Cowboy's Hello
Graded Autograder
You are a cowboy 🤠 . Using the std::cout
syntax1 you saw in the last activity, print out "Howdy, world!" to console. This activity is autograded.
-
The syntax is
std::cout << "Your Text Here" << std::endl;
↩
Question System
One of the newer contributions to the course is the graded question system within our daily lessons. Depending on the lesson, there will be different questions: select one, fill in the blank, or string input. We hope these questions help fill in those gaps in knowledge that may be less intuitive.
Now it's time for you to tinker around with the question system. Feel free to look further at the history of your answers and the feedback provided.