fork download
  1. package shoppingSystem;
  2.  
  3. public class Shop {
  4.  
  5. private String shopname;
  6. private Customer name;
  7. private String opendays;
  8. private int taxrate;
  9. private int money;
  10. boolean monday = false;
  11. boolean tuesday = false;
  12. boolean wednesday = false;
  13. boolean thursday = false;
  14. boolean friday = false;
  15. boolean saturday = false;
  16. boolean sunday = false;
  17. private double price;
  18. private double revenue;
  19. private boolean walletmoney;
  20. private boolean creditcard;
  21. Customer customer;
  22. String paymentmethod;
  23. Visit visit;
  24.  
  25. Shop(String n, String op, int tx, boolean walletmoney, boolean creditcard) {
  26. setShopName(n);
  27. setOpenDays(op);
  28. setTaxrate(tx);
  29. writeOpenDaysInBoolean(op);
  30. setRevenue(0);
  31.  
  32. opendays = opendays.replaceAll("Mo", "Monday");
  33. opendays = opendays.replaceAll("Tu", "Tuesday");
  34. opendays = opendays.replaceAll("We", "Wednesday");
  35. opendays = opendays.replaceAll("Th", "Thursday");
  36. opendays = opendays.replaceAll("Fr", "Friday");
  37. opendays = opendays.replaceAll("Sa", "Saturday");
  38. opendays = opendays.replaceAll("Su", "Sunday");
  39.  
  40. }
  41.  
  42. public String getShopName() {
  43. return shopname;
  44. }
  45.  
  46. public void setShopName(String shopName) {
  47. this.shopname = shopName;
  48. }
  49.  
  50. public String getOpendays() {
  51. return opendays;
  52. }
  53.  
  54. public void setOpenDays(String opendays) {
  55. this.opendays = opendays;
  56. }
  57.  
  58. public int getTaxrate() {
  59. return taxrate;
  60. }
  61.  
  62. public void setTaxrate(int taxrate) {
  63. this.taxrate = taxrate;
  64. }
  65.  
  66. public double showWalletmoney() {
  67. return showWalletmoney();
  68. }
  69.  
  70. public Customer getName() {
  71. return name;
  72. }
  73.  
  74. public void setRevenue(double revenue) {
  75. this.revenue = revenue;
  76. }
  77.  
  78. public double getRevenue() {
  79.  
  80. return revenue;
  81. }
  82.  
  83. public int getMoney() {
  84. return money;
  85. }
  86.  
  87. public void setMoney(int money) {
  88. this.money = money;
  89. }
  90.  
  91. public double getPrice() {
  92. return price;
  93. }
  94.  
  95. public void setPrice(double price) {
  96. this.price = price;
  97. }
  98.  
  99. public boolean isWalletmoney() {
  100. return walletmoney;
  101. }
  102.  
  103. public void setWalletmoney(boolean walletmoney) {
  104. this.walletmoney = walletmoney;
  105. }
  106.  
  107. public boolean isCreditcard() {
  108. return creditcard;
  109. }
  110.  
  111. public void setCreditcard(boolean creditcard) {
  112. this.creditcard = creditcard;
  113. }
  114.  
  115. public String getShopname() {
  116. return shopname;
  117. }
  118.  
  119. public void setShopname(String shopname) {
  120. this.shopname = shopname;
  121. }
  122.  
  123. public void writeOpenDaysInBoolean(String opendays) {
  124.  
  125. String[] openDaysArray = opendays.split(",");
  126.  
  127. for (String openDay : openDaysArray) {
  128.  
  129. switch (openDay) {
  130. case "Mo":
  131. monday = true;
  132. break;
  133.  
  134. case "Tu":
  135. tuesday = true;
  136. break;
  137.  
  138. case "We":
  139. wednesday = true;
  140. break;
  141.  
  142. case "Th":
  143. thursday = true;
  144. break;
  145.  
  146. case "Fr":
  147. friday = true;
  148. break;
  149.  
  150. case "Sa":
  151. saturday = true;
  152. break;
  153.  
  154. case "Su":
  155. sunday = true;
  156. break;
  157. }
  158. }
  159. }
  160.  
  161. public void showInformations() {
  162.  
  163. System.out.println(
  164. "Shopname : " + getShopName() + " OpenDays :" + getOpendays() + " TaxRate " + getTaxrate() + "%");
  165. }
  166.  
  167. public String publishSalesnumbers() {
  168.  
  169. return "Shop " + getShopName() + " revenue is = " + Math.round(getRevenue() * 100.0) / 100.0;
  170. }
  171.  
  172. }
  173.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class Shop is public, should be declared in a file named Shop.java
public class Shop {
       ^
Main.java:6: error: cannot find symbol
	private Customer name;
	        ^
  symbol:   class Customer
  location: class Shop
Main.java:21: error: cannot find symbol
	Customer customer;
	^
  symbol:   class Customer
  location: class Shop
Main.java:23: error: cannot find symbol
	Visit visit;
	^
  symbol:   class Visit
  location: class Shop
Main.java:70: error: cannot find symbol
	public Customer getName() {
	       ^
  symbol:   class Customer
  location: class Shop
5 errors
stdout
Standard output is empty