Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="sprint3/src"/>
<classpathentry kind="output" path="sprint3/bin"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 0 additions & 17 deletions .project

This file was deleted.

11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 0 additions & 2 deletions AdminAccounts.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
boss_|123456
toka_|123456789
salma3|123456
4 changes: 1 addition & 3 deletions Brands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ airpods|mobileaccessories
Moro|food
Loreal|haircare
Pantene|haircare
Clear|haircare
Clear|haircareh&m|clothes
hp|electronices
lenovo|electronices
iphone|electronices
18 changes: 15 additions & 3 deletions BuyedProduct.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
mai_ibrahim|nada_hatem|Shampo|1|Clear|190|Haram
nesma_thabet|salma2|chocolate|1|Moro|19.0|ll
nada_hatem|salma2|chocolate|2|Moro|14.0|Haram
Shampo|2|Loreal|122 Dokki
Shampo|2|Loreal|Mesadk
Shampo|1|Loreal|Sharm
Shampo|2|Loreal|Dokki
Shampo|2|Loreal|Haram
Shampo|2|Clear|Giza
Shampo|2|Clear|Kafr elshikh
Shampo|4|Pantene|Haram
Shampo|3|Clear|Maddi
Shampo|2|Loreal|122 Dokki
Shampo|1|Loreal|Haram
Shampo|1|Clear|Octobar
Shampo|4|Clear|Octobar
Shampo|3|Clear|Sheikh Zayed
Shampo|1|Pantene|Luxur
9 changes: 4 additions & 5 deletions Collaborator.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
noran|123456
NesmaHatem|159753
merret|123456
laila|123456
sahar_|123456789
nesma_thabet|noran|123456
noran_1|NesmaHatem|159753
merret1|merret|123456
salmaa1|laila|123456
2 changes: 1 addition & 1 deletion NumberBoughtProduct.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
13
15
2 changes: 1 addition & 1 deletion NumberOfAddedUsersAccounts.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
4
3 changes: 0 additions & 3 deletions Products.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ laptop|electronices|200|offfer
Tshirt|clothes|200|no_offfer
tables|furniture|3000|offfer
Shampo|haircare|200|offfer
Shampo|haircare|50|no_offer
chocolate|food|20|no_offer
mobile|electronices|6000|no_Offer
14 changes: 4 additions & 10 deletions ProductsOfStoreowner.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
nada_hatem|Shampo|haircare|200|Pantene|haircare|5
nada_hatem|Shampo|haircare|200|Loreal|haircare|4
noraan_|Shampo|haircare|200|Clear|haircare|6
salma2|laptop|electronices|200|hp|electronices|6
salma2|chocolate|food|20|Moro|food|10
nada_hatem|chocolate|food|20|Dairymilk|chocolate|10
nada_hatem|laptop|electronices|200|lenovo|electronices|10
nada_hatem|Shampo|haircare|50|Loreal|haircare|40
nada_hatem|mobile|electronices|6000|hp|electronices|8
nada_hatem|Shampo|haircare|200|Pantene|haircare|2
Shampo|haircare|200|Pantene|haircare|5
Shampo|haircare|200|Loreal|haircare|4
Shampo|haircare|200|Clear|haircare|6
laptop|electronices|200|hp|electronices|6
6 changes: 3 additions & 3 deletions Store.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
laylaStore|nada_hatem|clothes|Dokki
maha|nada_hatem|clothes|Haram
sahar|alaa_el_lol|makeup|Dokki
laylaStore|clothes|Dokki
maha|clothes|Haram
sahar|makeup|Dokki
3 changes: 0 additions & 3 deletions StoreOwnerAccounts.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
nada_hatem|123456789
alaa_el_lol|123456
nouran_mohamed|987654321
youmnaMohamed|123654
salma2|123456
noraan_|123456
7 changes: 0 additions & 7 deletions UserAccounts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,3 @@ nesma_thabet|159753
youmna_ahmed|123456789
mno77|3451267
merette_nabil|753951
noran_1|123456789
lailaa_|145632
merret1|123456789
nesma12|456987123
salmaa1|123456
youssefMohamed|123456
nesmaaThabit|159753
24 changes: 18 additions & 6 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/Adminstrator.class
/Brand.class
/BrandEntity.class
/BuyedProduct.class
/BuyedProductEntity.class
/Collaborator.class
/FileUsage.class
/Main.class
/ProductEntity.class
/ProductOfStoreowner.class
/ProductOfStoreownerEntity.class
/Store.class
/StoreEntity.class
/StoreOwner.class
/User.class
/UserEntity.class
/product.class
/sprint3/
/CheckAccountToBuyProduct.class
/StoreownerBuyProduct.class
/StoreOwnerAddColloborators.class
/StoreOwnerAddProducts.class
/StoreOwnerAddStores.class
/StoreOwnerBuyProducts.class
/systemUser.class
Binary file removed bin/Adminstrator.class
Binary file not shown.
Binary file removed bin/Brand.class
Binary file not shown.
Binary file removed bin/BrandEntity.class
Binary file not shown.
Binary file removed bin/BuyedProduct.class
Binary file not shown.
Binary file removed bin/BuyedProductEntity.class
Binary file not shown.
Binary file removed bin/Collaborator.class
Binary file not shown.
Binary file removed bin/FileUsage.class
Binary file not shown.
Binary file removed bin/Main.class
Binary file not shown.
Binary file removed bin/ProductEntity.class
Binary file not shown.
Binary file removed bin/ProductOfStoreowner.class
Binary file not shown.
Binary file removed bin/ProductOfStoreownerEntity.class
Binary file not shown.
Binary file removed bin/Store.class
Binary file not shown.
Binary file removed bin/StoreEntity.class
Binary file not shown.
Binary file removed bin/StoreOwner.class
Binary file not shown.
Binary file removed bin/User.class
Binary file not shown.
Binary file removed bin/UserEntity.class
Binary file not shown.
Binary file removed bin/product.class
Binary file not shown.
Binary file added bin/sprint4/NumberOfAddedAccounts.class
Binary file not shown.
Binary file added bin/sprint4/StatisticsStoreOwner.class
Binary file not shown.
Binary file added bin/sprint4/UserWantsViewProduct.class
Binary file not shown.
Binary file added bin/sprint4/numberOfBoughtProducts.class
Binary file not shown.
Binary file removed bin/systemUser.class
Binary file not shown.
2 changes: 1 addition & 1 deletion count.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
28
22
181 changes: 91 additions & 90 deletions src/Adminstrator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,96 +4,97 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Adminstrator extends systemUser {
public Adminstrator() throws Exception {
super();
}

public class Adminstrator extends systemUser {
public Adminstrator() throws Exception {
super();
}

@SuppressWarnings("resource")
public void addproducttosystem() throws Exception {
Scanner userInput2 = new Scanner(System.in);
System.out.println("name of products is:");
String Pname = userInput2.nextLine();
System.out.println("category of products is:");
String Pcategory = userInput2.nextLine();
System.out.println("price of products is:");
String Pprice = userInput2.nextLine();
System.out.println("offer on products is:");
String Poffer = userInput2.nextLine();
new product().addproductinfo(Pname, Pcategory, Pprice, Poffer);
}

boolean check = true;

@SuppressWarnings("resource")
public boolean AcceptStore() {
System.out.println("Do you want to add this store to storeOwner enter 1 if no enter 2");
Scanner request = new Scanner(System.in);
int what = request.nextInt();
if (what == 1) {
return check;
}
check = false;
return check;
}

@SuppressWarnings("resource")
public void addBrandtosystem() throws Exception {
Scanner userInput2 = new Scanner(System.in);
System.out.println("name of Brands is:");
String name = userInput2.nextLine();
System.out.println("category of Brands is:");
String category = userInput2.nextLine();
new Brand().addBrandinfo(name, category);
}

@SuppressWarnings("resource")
public void addnewstatistics() throws IOException {

ArrayList<UserEntity> numUsers = new ArrayList<UserEntity>();
BufferedReader reader1 = new BufferedReader(new FileReader(new File("UserAccounts.txt")));
String line1;
while ((line1 = reader1.readLine()) != null) {
String[] arr = line1.split("\\|");
numUsers.add(new UserEntity(arr[0], arr[1]));
}
int j;
for (j = 0; j < numUsers.size(); ++j) {
}
System.out.println("Number of users register: " + j);

ArrayList<UserEntity> numStoreOwners = new ArrayList<UserEntity>();
BufferedReader reader2 = new BufferedReader(new FileReader(new File("StoreOwnerAccounts.txt")));
String line2;
while ((line2 = reader2.readLine()) != null) {
String[] arr1 = line2.split("\\|");
numStoreOwners.add(new UserEntity(arr1[0], arr1[1]));
}
int k;
for (k = 0; k < numStoreOwners.size(); ++k) {
}
System.out.println("Number of storeOwners register: " + k);

ArrayList<ProductEntity> products = new ArrayList<ProductEntity>();
BufferedReader reader3 = new BufferedReader(new FileReader(new File("Products.txt")));
String line3;
while ((line3 = reader3.readLine()) != null) {
String[] arr = line3.split("\\|");
products.add(new ProductEntity(arr[0], arr[1], arr[2], arr[3]));
}
int i;
for (i = 0; i < products.size(); ++i) {
}
System.out.println("Number of products: " + i);
System.out.println("Products & Offers ]::::");
BufferedReader br1 = new BufferedReader(new FileReader(new File("Products.txt")));
String line4 = br1.readLine();
while (line4 != null) {
String[] arr = line4.split("\\|");
System.out.println(arr[0] + " " + arr[3]);
line4 = br1.readLine();
}
}
@SuppressWarnings("resource")
public void addproducttosystem()throws Exception {
Scanner userInput2 = new Scanner(System.in);
System.out.println("name of products is:");
String Pname = userInput2.nextLine();
System.out.println("category of products is:" );
String Pcategory = userInput2.nextLine();
System.out.println("price of products is:" );
String Pprice = userInput2.nextLine();
System.out.println("offer on products is:");
String Poffer = userInput2.nextLine();
new product().addproductinfo(Pname,Pcategory, Pprice,Poffer);
}
boolean check=true;
@SuppressWarnings("resource")
public boolean AcceptStore() {
System.out.println("Do you want to add this store to storeOwner enter 1 if no enter 2");
Scanner request=new Scanner(System.in);
int what=request.nextInt();
if(what==1) {
return check;
}
check=false;
return check;
}
@SuppressWarnings("resource")
public void addBrandtosystem()throws Exception {
Scanner userInput2 = new Scanner(System.in);
System.out.println("name of Brands is:");
String name = userInput2.nextLine();
System.out.println("category of Brands is:" );
String category = userInput2.nextLine();
new Brand().addBrandinfo(name,category);
}


@SuppressWarnings("resource")
public void addnewstatistics() throws IOException {

ArrayList<UserEntity> numUsers = new ArrayList<UserEntity>();
BufferedReader reader1 = new BufferedReader(new FileReader(new File("UserAccounts.txt")));
String line1;
while((line1 = reader1.readLine()) != null) {
String[] arr = line1.split("\\|");
numUsers.add(new UserEntity(arr[0], arr[1]));
}
int j;
for(j = 0; j < numUsers.size(); ++j) {
}
System.out.println("Number of users register: "+j);



ArrayList<UserEntity> numStoreOwners = new ArrayList<UserEntity>();
BufferedReader reader2 = new BufferedReader(new FileReader(new File("StoreOwnerAccounts.txt")));
String line2;
while((line2 = reader2.readLine()) != null) {
String[] arr1 = line2.split("\\|");
numStoreOwners.add(new UserEntity(arr1[0], arr1[1]));
}
int k;
for(k = 0; k < numStoreOwners.size(); ++k) {
}
System.out.println("Number of storeOwners register: "+k);



ArrayList<ProductEntity> products = new ArrayList<ProductEntity>();
BufferedReader reader3 = new BufferedReader(new FileReader(new File("Products.txt")));
String line3;
while((line3 = reader3.readLine()) != null) {
String[] arr = line3.split("\\|");
products.add(new ProductEntity(arr[0], arr[1], arr[2],arr[3]));
}
int i;
for(i = 0; i < products.size(); ++i) {
}
System.out.println("Number of products: "+i);
System.out.println(" Products & Offers :");
BufferedReader br1 = new BufferedReader(new FileReader(new File("Products.txt")));
String line4= br1.readLine();
while(line4 != null) {
String[] arr = line4.split("\\|");
System.out.println(arr[0]+" "+arr[3]);
line4=br1.readLine();
}
}

}
1 change: 0 additions & 1 deletion src/Brand.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import java.io.IOException;
import java.util.ArrayList;
public class Brand {
product p=new product();
@SuppressWarnings("unused")
private
String bname;
Expand Down
Loading