Iām a software developer passionate about creating new projects and working on challenging code.Some of my hobbies are playing soccer, running, and working out.I recently finished my first marathon in Atlanta. I've also participated as a student coach in the Cyber Power Camp: Mars Rover Mission Edition at Aiken Technical College.
// C++ Example-Game lobby
#include iostream
#include string
using namespace std;
class Player
{
public:
Player(const string& name = "");
string GetName() const;
Player* GetNext() const;
void SetNext(Player* next);
private:
string m_Name;
Player* m_pNext; //Pointer to next player in list
};
Player::Player(const string& name) :
m_Name(name),
m_pNext(0)
{}
string Player::GetName() const
{
return m_Name;
}
Player* Player::GetNext() const
{
return m_pNext;
}
void Player::SetNext(Player* next)
{
m_pNext = next;
}
class Lobby
{
friend ostream& operator<<(ostream& os, const Lobby& aLobby);
public:
Lobby();
~Lobby();
void AddPlayer();
void RemovePlayer();
void searchplayer();
void Clear();
private:
Player* m_pHead;
};
Lobby::Lobby() :
m_pHead(0)
{}
Lobby::~Lobby()
{
Clear();
}
void Lobby::AddPlayer()
{
//create a new player node
cout << "Please enter the name of the new player: ";
string name;
cin >> name;
Player* pNewPlayer = new Player(name);
//if list is empty, make head of list this new player
if (m_pHead == 0)
{
m_pHead = pNewPlayer;
}
//otherwise find the end of the list and add the player there
else
{
Player* pIter = m_pHead;
while (pIter->GetNext() != 0)
{
pIter = pIter->GetNext();
}
pIter->SetNext(pNewPlayer);
}
}
void Lobby::RemovePlayer()
{
if (m_pHead == 0)
{
cout << "The game lobby is empty. No one to remove!\n";
}
else
{
Player* pTemp = m_pHead;
m_pHead = m_pHead->GetNext();
delete pTemp;
}
}
void Lobby::Clear()
{
while (m_pHead != 0)
{
RemovePlayer();
}
}
ostream& operator<<(ostream& os, const Lobby& aLobby)
{
Player* pIter = aLobby.m_pHead;
os << "\nHere's who's in the game lobby:\n";
if (pIter == 0)
{
os << "The lobby is empty.\n";
}
else
{
while (pIter != 0)
{
os << pIter->GetName() << endl;
pIter = pIter->GetNext();
}
}
return os;
}
void Lobby::searchplayer() {
string searchname;
cout << "enter name to search: ";
cin >> searchname;
Player* iter = m_pHead;
bool found = false;
while (iter != 0) {
if (iter->GetName() == searchname) {
found = true;
break;
}
iter = iter->GetNext();
}
if (found==true) {
cout << "Player Found!!!\n";
}
else {
cout << "Player Not Found!!\n";
}
}
int main()
{
Lobby myLobby;
int choice;
do
{
cout << myLobby;
cout << "\nGAME LOBBY\n";
cout << "0 - Exit the program.\n";
cout << "1 - Add a player to the lobby.\n";
cout << "2 - Remove a player from the lobby.\n";
cout << "3 - Clear the lobby.\n";
cout << "4- Search lobby.\n";
cout << endl << "Enter choice: ";
cin >> choice;
switch (choice)
{
case 0: cout << "Good-bye.\n"; break;
case 1: myLobby.AddPlayer(); break;
case 2: myLobby.RemovePlayer(); break;
case 3: myLobby.Clear(); break;
case 4:myLobby.searchplayer(); break;
default: cout << "That was not a valid choice.\n";
}
} while (choice != 0);
return 0;
}
<!DOCTYPE html>
<html lang="en">
<!DOCTYPE html>
<html lang="en">
<Mardi Gras website->
<head>
<meta charset="utf-8">
<title>Gunter,Colt Mardi Gras Store</title>
<link rel="icon" href="images/faviconMG.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/main.css">
</head>
<body>
<header>
<img src="images/MardiGrasLogo.png" alt="Mardi Gras Logo">
<h2>Welcome party animals</h2>
<h3>Prepare to celebrate!</h3>
</header>
<nav id="nav_menu">
<ul>
<li><a href="index.html" class="current">Home</a></li>
<li><a href="products/index.html">Product List</a></li>
<li><a href="personal/index.html">Personal</a></li>
<li><a href="decorating/index.html">Decorating Ideas</a>
<ul>
<li><a href="decorating/outdoor.html">Outdoor</a></li>
<li><a href="decorating/indoor.html">Indoor</a></li>
<li><a href="decorating/table.html">Table</a></li>
<li><a href="decorating/snacks.html">Snacks</a></li>
</ul>
</li>
<li><a href="email.html">Join Email</a></li>
</ul>
</nav>
<main>
<aside>
<nav id="nav_list">
<ul>
<li><a href="products/beads.html">Beads</a></li>
<li><a href="products/masks.html">Masks</a></li>
<li><a href="products/floats.html">Parade Floats</a></li>
<li><a href="products/props.html">Props</a></li>
</ul>
</nav>
</aside>
<section>
<h1>Sam's Mardi Gras Store</h1>
<p>Growing up in New Orleans, Louisiana I always looked forward to the annual February celebration of Mardi Gras.
From crazy masks to wild parade floats and beads everywhere there is no time where the people of New Orleans
enjoy celebrating like Mardi Gras. I started this web site because all the other stores
selling Mardi Gras supplies were just too expensive.</p> <p>If you click on the Parade Floats link,
you can browse my favorite float pictures from years past. If you join my email list,
I will keep you up-to-date on all things Mardi Gras.</p>
<h2>Featured Products This Week: <a href="products/masks.html">Masks</a></h2>
<p><img src="images/MaskBlue.jpg" alt="Blue Mask"></p>
<h3>My guarantee</h3>
<p>If you aren't completely satisfied with everything you buy from my site, you can return it
for a full refund. <strong>No questions asked!</strong></p>
</section>
</main>
<footer>
<p>© 2020 Sam Sidewinder</p>
</footer>
</body>
</html>
// JavaScript Example
Hello, (your name)
const name = prompt("What is your name?");
const greeting = document.getElementById("greeting");
if (name && name.trim() !== "") {
greeting.textContent = `Hello, ${name.trim()}!`;
}
input="Colt"
Email me at: coltg124@gmail.com
Linkedin: My Linkedin