/*
Exam 1 Lab Section
author: YOUR_USERNAME@student.ysu.edu
Please rename this file to YOUR_USERNAME_exam1_lab.cpp
and send as an attachment to james.dittrich+YSU@gmail.com 
*/

#include <iostream> // basic i/o
#include <iomanip> // output formatting
#include <cmath> // math functions
#include <cstdlib> // rand() and srand()
#include <ctime> // system time

using namespace std;

void lab1(void){
/* 
L1: Descending the Staircase (10 pts.)
Produce the output sequence
100, 81, 64, 49, 36, 25, 16, 9, 4, 1
using only a single variable and without using multiplication (*) or addition (+)
*/

	cout << "\n*** L1: Descending the Staircase ***" << endl;

	// your code here
	return;
}



void lab2(int n){
/*
L2: Echoes of Gauss (10 pts.)
Write this function that takes an integer parameter n as input, 
that calculates the sum of the first n integers, e.g.:
when n = 3, 1 + 2 + 3 = 6
and prints out the correct value (you don't need to return it).
When the value of n is a negative integer, return 0.
It may be helpful to print out intermediate values while 
debugging, comment those statements out afterwards.
*/
	cout << "\n*** L2: Echoes of Gauss ***" << endl;
	// your code here
	return;
}



void lab3(void){
// L3: Fight Club (10 pts.)

	// TODO: get system time

	// TODO: seed the random number generator

	cout << "*** L3: Fight Club **" << endl;
	cout << "Welcome to Fight Club" << endl;
	int tyler; 
	int robert;

	// TODO: roll two regular 6-sided die for each player below and assign the sum (2-12)

	// TODO: write a conditional that handles the following 3 situations:
	// Tyler's score is higher:
	
		cout << "Tyler Durden wins!" << endl;
	
	// Robert's score is higher:
	
		cout << "Robert Paulson wins!" << endl;
	
	// Both roll the same amount:
	
		cout << "It's a draw." << endl;

	/*	
	TODO: Add user input to the program with a prompt to "play again (y/n): "
	you can safely assume the user will enter a lowercase letter.

	TODO: Add a loop that repeats the game and prints the outcome each time
	HINT: make sure there is a new, unique set of die rolls each replay.
	HINT: you can both test the user input and repeat by adding just one while loop!
	Consider using a boolean value, which represents whether or not to repeat, in order to control the loop.
	*/
	return;
}



void lab4(void){
	// L4: Nikolaevskaya Railway (10 pts.)
	// The distance of the Nikolaevskaya railway first constructed by Czar Nicholas I
	// completed in 1851 that connects St. Petersburg and Moscow is 649.7km.
	
	// Use the following train schedule:
	// St. Petersburg to Moscow
	// 5:30AM - 9:15AM
	// 3h 45m (225 minutes)
	// Moscow to St. Petersburg
	// 5:45AM - 9:15AM
	// 3h 30m (210 minutes)

	// If both trains depart on time, given their respective average velocity,
	// at what time will they pass each other?

	// TODO: get the average velocity of each train.
	// HINT: use minutes as the time unit.
	float velStP_Mos, velMos_StP;
	float dist = 649.7;

	// TODO: compute the velocity

	cout << "Average velocity (St. Petersburg-Moscow): " << velStP_Mos << endl;
	cout << "Average velocity (Moscow-St. Petersburg): " << velMos_StP << endl;

	// TODO: set the starting distances
	// HINT: declare two variables keep track of both!

	int minutes = 0;
	// TODO: check the amount traveled each minute to see when they pass.
	// HINT: remember to account for the differing departure times.
	// St. Petersburg to Moscow has a head start of 15 minutes!

	// TODO: print out the clock time when they pass.

	return;
}


int main(){
	
	// call the above functions here.
	// TODO: call lab1
	// TODO: call lab2, passing n = 100.
	// TODO: call lab3
	// TODO: call lab4
	return 0;
}
