Skip to content

Commit

Permalink
ogolne poprawki
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelKawula committed Dec 2, 2017
1 parent 92fe321 commit bf143b4
Show file tree
Hide file tree
Showing 121 changed files with 798 additions and 297 deletions.
2 changes: 1 addition & 1 deletion r10,1/BankBill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void BankBill::addBalance(double ab)
std::cout << "Operacja przerwana" << std::endl;
}
else
balance -= ab;
balance += ab;
}

void BankBill::subBalance(double ab)
Expand Down
6 changes: 3 additions & 3 deletions r10,1/r10,1.depend
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# depslib dependency file v1.0
1503741982 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\bankbill.cpp
1503738382 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\bankbill.cpp
"BankBill.h"

1503742854 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\bankbill.h
1503739254 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\bankbill.h
<iostream>

1503742590 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\main.cpp
1503738990 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,1\main.cpp
<iostream>
"BankBill.h"

8 changes: 4 additions & 4 deletions r10,1/r10,1.layout
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="80" topLine="0" />
<Cursor1 position="228" topLine="0" />
</Cursor>
</File>
<File name="BankBill.h" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="BankBill.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="77" topLine="0" />
</Cursor>
</File>
<File name="BankBill.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="BankBill.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="23" topLine="0" />
<Cursor1 position="523" topLine="9" />
</Cursor>
</File>
</CodeBlocks_layout_file>
12 changes: 6 additions & 6 deletions r10,2/r10,2.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="person.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="39" topLine="0" />
</Cursor>
</File>
<File name="person.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="233" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="189" topLine="0" />
</Cursor>
</File>
<File name="person.cpp" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="39" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
Binary file modified r10,3/bin/Debug/r10,3.exe
Binary file not shown.
10 changes: 7 additions & 3 deletions r10,3/golf.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#include "golf.h"
Golf & Golf::operator=(Golf & g)
{
Golf newg;
strncpy(newg.fname,g.fname,LEN);
newg.handicap = g.handicap;
strncpy(fname, g.fname, LEN);
handicap = g.handicap;
return *this;
}

void Golf::showgolf() const
{
cout << fname << ", handicap: " << handicap << endl;
}
5 changes: 3 additions & 2 deletions r10,3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ using std::cin;

int main()
{
Golf g;
Golf copyg;
Golf g("Pawel",23);
Golf copyg("kaw",21);
copyg = g;
copyg.showgolf();
return 0;
}
Binary file modified r10,3/obj/Debug/golf.o
Binary file not shown.
Binary file modified r10,3/obj/Debug/main.o
Binary file not shown.
6 changes: 3 additions & 3 deletions r10,3/r10,3.depend
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# depslib dependency file v1.0
1503746961 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\golf.cpp
1512068013 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\golf.cpp
"golf.h"

1503747079 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\golf.h
1503743479 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\golf.h
<cstring>
<iostream>

1503746975 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\main.cpp
1512067949 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,3\main.cpp
<iostream>
"golf.h"

12 changes: 6 additions & 6 deletions r10,3/r10,3.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="golf.h" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="golf.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="398" topLine="0" />
<Cursor1 position="89" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="golf.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="156" topLine="0" />
<Cursor1 position="398" topLine="0" />
</Cursor>
</File>
<File name="golf.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="main.cpp" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="41" topLine="0" />
<Cursor1 position="216" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
Binary file added r10,4/bin/Debug/r10,4.exe
Binary file not shown.
6 changes: 4 additions & 2 deletions r10,4/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include <iostream>

#include "sales.h"
using namespace std;

int main()
{
cout << "Hello world!" << endl;
double bal[Sales::QUARTERS] {2, 5, 4, 5};
Sales s1(bal, 4);
s1.showSales();
return 0;
}
Binary file modified r10,4/obj/Debug/main.o
Binary file not shown.
Binary file added r10,4/obj/Debug/sales.o
Binary file not shown.
9 changes: 8 additions & 1 deletion r10,4/r10,4.depend
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# depslib dependency file v1.0
1446671344 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,4\main.cpp
1512068710 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,4\main.cpp
<iostream>
"sales.h"

1512068764 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,4\sales.cpp
"sales.h"

1512068740 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,4\sales.h
<iostream>

12 changes: 6 additions & 6 deletions r10,4/r10,4.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="sales.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="sales.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20" topLine="0" />
<Cursor1 position="199" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="sales.cpp" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="395" topLine="2" />
</Cursor>
</File>
<File name="sales.h" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="314" topLine="0" />
<Cursor1 position="169" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
36 changes: 36 additions & 0 deletions r10,4/sales.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
#include "sales.h"

Sales::Sales(const double ar[], int n)
{
double minimum = ar[0];
double maximum = ar[0];
double sum = 0;
int i;
for (i = 0; i < n; ++i)
{
if(minimum > ar[i])
minimum = ar[i];
if(maximum < ar[i])
maximum = ar[i];
balance[i] = ar[i];
sum += ar[i];
}
for (; i < QUARTERS; ++i)
{
balance[i] = 0;
}
min = minimum;
max = maximum;
average = sum / i;
}

void Sales::showSales() const
{
cout << "Sprzedaz: " << endl;
for (int i = 0; i < QUARTERS; ++i)
{
cout << "Kwartal " << i+1 << ": " << balance[i] << endl;
}
cout << "Srednia: " << average << endl;
cout << "Wartosc najmniejsza: " << min << endl;
cout << "Wartosc najwieksza: " << max << endl;
}
22 changes: 4 additions & 18 deletions r10,4/sales.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,17 @@ using std::cin;

class Sales
{
public:
static const int QUARTERS = 4;
private:
double balance[QUARTERS];
double average;
double max;
double min;
public:
Sales(const double * ar[])
{
double minimum = ar[0];
double maximum = ar[0];
double sum = 0;
for (int i = 0; i < QUARTERS; ++i)
{
if(minimum > ar[i])
minimum = ar[i];
if(maximum < ar[i])
maximum = ar[i];
balance[i] = ar[i];
sum += ar[i];
}
min = minimum;
max = maximum;
average = sum / i+1;
}

Sales(const double ar[], int n);
void showSales() const;
};


Expand Down
Binary file modified r10,5/bin/Debug/r10,5.exe
Binary file not shown.
Binary file modified r10,5/obj/Debug/main.o
Binary file not shown.
Binary file modified r10,5/obj/Debug/stack.o
Binary file not shown.
8 changes: 4 additions & 4 deletions r10,5/r10,5.depend
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# depslib dependency file v1.0
1503756789 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\main.cpp
1503753189 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\main.cpp
"stack.h"

1503752452 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\stack.h
<iostream>
1512068838 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\stack.h
<cstring>
<iostream>

1503756694 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\stack.cpp
1512068917 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,5\stack.cpp
"stack.h"

13 changes: 9 additions & 4 deletions r10,5/r10,5.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="main.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="827" topLine="0" />
<Cursor1 position="1132" topLine="0" />
</Cursor>
</File>
<File name="stack.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="stack.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="394" topLine="1" />
</Cursor>
</File>
<File name="stack.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="189" topLine="6" />
</Cursor>
</File>
</CodeBlocks_layout_file>
4 changes: 0 additions & 4 deletions r10,5/stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

void Stack::addCustomer(const char* fname, double pay)
{
if(customersLeft < 0)
customersLeft = 0;
strncpy(customers[customersLeft].fullname,"",NAMEMAX);
strncpy(customers[customersLeft].fullname,fname,NAMEMAX);
customers[customersLeft].payment = 0;
customers[customersLeft].payment = pay;
++customersLeft;
}
Expand Down
5 changes: 3 additions & 2 deletions r10,5/stack.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#ifndef STACK_H_INCLUDED
#define STACK_H_INCLUDED

#include <cstring>
#include <iostream>

using std::cout;
using std::endl;
using std::cin;
using std::string;
using std::getline;
#include <cstring>

const int NAMEMAX = 35;
struct customer
{
Expand Down
Binary file modified r10,6/bin/Debug/r10,6.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion r10,6/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using namespace std;

int main()
{
Move one;
Move one(3,32);
Move two(1,10);
Move three;
three = one.add(two);
Expand Down
Binary file modified r10,6/obj/Debug/main.o
Binary file not shown.
6 changes: 3 additions & 3 deletions r10,6/r10,6.depend
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# depslib dependency file v1.0
1503757642 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\main.cpp
1503754042 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\main.cpp
<iostream>
"Move.h"

1503757522 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\move.cpp
1503753922 source:c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\move.cpp
"Move.h"

1503757487 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\move.h
1503753887 c:\users\p4wos\desktop\j�zyk c++ szko�a programowania\r10,6\move.h
<iostream>

12 changes: 11 additions & 1 deletion r10,6/r10,6.layout
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="move.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="Move.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="200" topLine="0" />
<Cursor1 position="98" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
2 changes: 2 additions & 0 deletions r10,7/plorg.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ using std::endl;

class Plorg
{
public:
static const int NAMEMAX = 19;
private:
char name[NAMEMAX];
int fulness;
public:
Expand Down
Loading

0 comments on commit bf143b4

Please sign in to comment.