程序代写代做代考 SIT102 Introduction to Programming

SIT102 Introduction to Programming
Credit Task 2.3: Custom Header Overview
In the User Input Functions task you created a number of reusable functions. Lets see how you can package these to make them much easier to use in other projects.
Submission Details
Use the instructions on the following pages to package up your own Terminal User Input file, and add some code documentation to describe what it does.
Submit the following files to OnTrack.
Your new header file
The code for your terminal user input code Your program¡¯s code
The focus of this task is on packaging up functions to be reused by yourself and others.

Instructions
In this task we will package up the functions you created to handle user input and add some code documentation to describe what it does.
Lets get started.
1. Watch the 2.3C Custom Header video, and make the changes shown to your own Hello User project.
Here are some notes related to these steps:
Remember to cd into the project folder at the start and to open that folder in Visual Studio
Code.
You can compile using:
skm clang++ program.cpp terminal_user_input.cpp -o HelloUser or with a * wildcard…
skm clang++ *.cpp -o HelloUser
You can include your own header using:
#include “terminal_user_input.h”
Include header comments above each function in the header
/**
* Prompts the user
* at the Terminal.
* as a string.
*
* @param prompt
* @returns */
for input and reads the text that the user enters This will read in a line of text and return this
The message displayed to the user The text the user enters
string read_string(string prompt);
2. Move the code for read_string , read_integer , and read_double into the new
terminal_user_input.cpp file and its matching header.
Make sure you have each function in the terminal_user_input.h header file
Put the implementation of the functions in the terminal_user_input.cpp file
Add code documentation to the header file to describe each function. Remember to explain what they do, not how they do it.
You can now reuse these functions by copying these two files into any project you want! So make sure to back them up!
You will need to submit your header file along with the two code files.

Task Discussion
Discuss the following with your tutor to demonstrate your understanding of the concepts covered.
Forward declaration of functions – what is this, and why is it needed?
The role of a header file and how this works with #include
How you can use this header and separate file in all of your other tasks using terminal input! Now you have it in a reusable bundle… how will you use it for future tasks?