<commit_before>// This program demonstrates use of functions	
// Title: functions
// Programmer: <NAME>
// Last Modified: Nov 6, 2015

#include <iostream>
using namespace std;

double getNum();		// not required for lab. helper function
int getInt();			// not required for lab. helper function
double getPos();
double getPosNum();
int getMultOfFive();
char getLetter();
double getInRange(double start, double end);
int getPerfectSquare();
int getMultOfNum(int num);

void main() {
	double start, end;		// for part 5
	int num;				// for part 7

	// print title
	cout
		<< "\n\t This program demonstrates how to use functions "
		<< "\n\t                  by <NAME>                  " << endl << endl;

	while (true) {
		/////////////////////////////////////////// Part 1 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 1 (get positive number - assume number is entered)\n"
		<< "   **  write and use the getPos() function   **";

		// print output with function call
		cout << "\tGood! " << getPos() << " is positive!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 2 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 2 (get positive number - no assumption)\n"
		<< "   **  write and use the getPosNum() function   **";

		// print output with function call
		cout << "\tGood! " << getPosNum() << " is positive!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 3 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 3 (get a multiple of 5)\n"
		<< "   **  write and use getMultOfFive() function    **";

		// print output with function call
		cout << "\tGood! " << getMultOfFive() << " is a multiple of 5!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 4 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 4 (get a letter)\n"
			<< "   **  write and use the getLetter() function  **";

		// print output with function call
		cout << "\tGood! " << getLetter() << " is a letter!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n"; 

		/////////////////////////////////////////// Part 5 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 5 (get a number between [start, end])\n"
			<< "   **  write and use getInRange(start, end) function   **";

		// get input for function arguments
		cout << "\nWhat is the starting point? ";
		start = getNum();
		cout << "What is the ending point? ";
		end = getNum();

		// print output with function call
		cout << "\tGood! " << getInRange(start, end) << " is in [" << start << ", " << end << "]";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n"; 

		/////////////////////////////////////////// Part 6 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 6 (get a perfect square)\n"
		<< "   **  write and use getPerfectSquare() function   **";

		// print output with function call
		cout << "\tGood! " << getPerfectSquare() << " is a perfect square!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 7 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 7 (get a multiple of n)\n"
		<< "   **  write and use getMultOfNum(int) function    **";

		// get input for function arguments
		cout << "\nWhat number do you want to get a multiple of? ";
		num = getInt();

		// print output with function call
		cout << "        Good! " << getMultOfNum(num) << " is a multiple of " << num << "!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";
	}
}

double getNum() {
	double x;<commit_msg>remove prompt from functions and pass function output to variable<commit_after>// This program demonstrates use of functions	
// Title: functions
// Programmer: <NAME>
// Last Modified: Nov 6, 2015

#include <iostream>
using namespace std;

double getNum();		// not required for lab. helper function
int getInt();			// not required for lab. helper function
double getPos();
double getPosNum();
int getMultOfFive();
char getLetter();
double getInRange(double start, double end);
int getPerfectSquare();
int getMultOfNum(int num);

void main() {
	double holdDbl;
	int holdInt;
	char holdCh;
	double start, end;		// for part 5
	int num;				// for part 7

	// print title
	cout
		<< "\n\t This program demonstrates how to use functions "
		<< "\n\t                  by <NAME>                  " << endl << endl;

	while (true) {
		/////////////////////////////////////////// Part 1 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 1 (get positive number - assume number is entered)\n"
			<< "   **  write and use the getPos() function   **";

		// get input
		holdDbl = getPos();

		// print output
		cout << "\tGood! " << holdDbl << " is positive!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 2 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 2 (get positive number - no assumption)\n"
			<< "   **  write and use the getPosNum() function   **";

		// get input
		holdDbl = getPosNum();

		// print output
		cout << "\tGood! " << holdDbl << " is positive!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 3 ///////////////////////////////////////////

		// print section description
		cout 
			<< "Part 3 (get a multiple of 5)\n"
			<< "   **  write and use getMultOfFive() function    **";

		// get input
		holdInt = getMultOfFive();

		// print output
		cout << "\tGood! " << holdInt << " is a multiple of 5!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 4 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 4 (get a letter)\n"
			<< "   **  write and use the getLetter() function  **";

		// get input
		holdCh = getLetter();

		// print output
		cout << "\tGood! " << holdCh << " is a letter!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n"; 

		/////////////////////////////////////////// Part 5 ///////////////////////////////////////////

		// print section description
		cout
			<< "Part 5 (get a number between [start, end])\n"
			<< "   **  write and use getInRange(start, end) function   **";

		// get input for function arguments
		cout << "\nWhat is the starting point? ";
		start = getNum();
		cout << "What is the ending point? ";
		end = getNum();
		


		// print output
		cout << "\tGood! " << getInRange(start, end) << " is in [" << start << ", " << end << "]";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n"; 

		/////////////////////////////////////////// Part 6 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 6 (get a perfect square)\n"
		<< "   **  write and use getPerfectSquare() function   **";

		// print output
		cout << "\tGood! " << getPerfectSquare() << " is a perfect square!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";

		/////////////////////////////////////////// Part 7 ///////////////////////////////////////////

		// print section description
		cout
		<< "Part 7 (get a multiple of n)\n"
		<< "   **  write and use getMultOfNum(int) function    **";

		// get input for function arguments
		cout << "\nWhat number do you want to get a multiple of? ";
		num = getInt();

		// print output
		cout << "        Good! " << getMultOfNum(num) << " is a multiple of " << num << "!";

		// separator
		cout << "\n\n~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n\n";
	}
}

double getNum() {
	double x;
{'fraction_non_alphanumeric': 0.31207934821112293, 'fraction_numerical': 0.005431573975675995, 'mean_word_length': 1.4234620886981402, 'pattern_counts': {'":': 0, '<': 229, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 56, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4590118', 'n_tokens_mistral': 2829, 'n_tokens_neox': 2495, 'n_words': 747}