Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
chowdhur2 committed Mar 20, 2020
1 parent a158bfc commit a9c74464c61c61ba89dec443092fdc8475c2a421
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
@@ -0,0 +1,59 @@
#pragma once
class Inventory
{
private:
int itemID;
int amount;
double cost;
double totalCost;
public:
Inventory() // declare the Inventory object using the constructor
{
itemID = 0;
amount = 0;
cost = 0;
totalCost = 0;

}
Inventory(int newItemID, int newamount, double newCost)
{
itemID = newItemID;
amount = newamount;
cost = newCost;
setTotalCost(amount, cost);
}

void setItemID(int)
{
itemID = itemID;
}
void setamount(int)
{
amount = amount;
}
void setCost(double)
{
cost = cost;
}
void setTotalCost(int, double)
{
totalCost = amount * cost;
}

int getItemID()
{
return itemID;
}
int getQuantity()
{
return amount;
}
double getCost()
{
return cost;
}
double getTotalCost()
{
return totalCost;
}
};
50 timer.h
@@ -0,0 +1,50 @@
#include <iomanip>
#include <iostream>
#include <stdlib.h>
#include <Windows.h>
using namespace std;
class timer
{
int hours = 0;
int minutes = 0;
int seconds = 0;

// function to display the timer
void CounterClock()
{
// system call to clear the screen
system("cls");

cout << setfill(' ') << setw(26) << " COUNTERCLOCK \n";
cout << setfill(' ') << setw(26) << " ..........................\n";
cout << setfill(' ') << setw(19);
cout << "| " << setfill('0') << setw(2) << hours << " hrs | ";
cout << setfill('0') << setw(2) << minutes << " min | ";
cout << setfill('0') << setw(2) << seconds << " sec |" << endl;
cout << setfill(' ') << setw(26) << " ...........................\n";
}

void countdown()
{
while (true) {
CounterClock();

Sleep(1);

seconds++;

if (seconds == 60) {
minutes++;

if (minutes == 60) {
hours++;
minutes = 0;

}
seconds = 0;
}
}
}

};

0 comments on commit a9c7446

Please sign in to comment.