code
stringlengths
3
1.18M
language
stringclasses
1 value
package dhtpdud; public class Java_4_6 { public static void main ( String[] args ) { int n; int hap; System.out.println("***** result *****"); n = hap = 0; for(n=1; n<=100; n++) { hap += n; } System.out.println("1+2+3+...+100 = "+hap+" (for statement)"); n = 1; hap = 0...
Java
package dhtpdud; import java.io.BufferedReader; import java.io.InputStreamReader; public class Java_4_5 { public static void main ( String[] args ) throws java.io.IOException { int jumsu; char hakjum; String iput; System.out.println("***** result *****"); System.out.print("Inp...
Java
package dhtpdud; class MyClass { int i_num; double d_num; String string_value; public MyClass( int i ) { i_num = i; } public MyClass( int i, double d ) { i_num = i; d_num = d; } public MyClass( int i, double d, String _string ) { i_num = i; d_num = d; string_value = _string; } public voi...
Java
package dhtpdud; public class Java_4_2 { public static void main( String[] args ) throws java.io.IOException { int x; System.out.print("x == ?"); x = System.in.read() - '0'; System.out.println("***** result *****"); if(x>0){ System.out.println("x is greater than ...
Java
package dhtpdud; public class dhtpduddhtpdud { public static void main ( String[] argc){ System.out.println("HELLO"); } }
Java
package dhtpdud; public class Java_3_5 { public static void main ( String[] args ) { int ken = 2, boo = 7, yoo = -7; System.out.println("***** result *****"); System.out.println("ken = 2, boo = 7, yoo = -7"); System.out.println("--- bitwise AND ---"); System.out.println("ken&boo -> "+(ken&b...
Java
package dhtpdud; public class Java_homework_3_4 { public static void main( String[] args ) { char alphabet; for ( alphabet='A'; alphabet<='Z'; alphabet++ ) { System.out.print(alphabet+" "); } } }
Java
package dhtpdud; public class Java_3_6 { public static void main ( String[] args ) { int x = 7, y = 2; int a, b; a = 7; b = 2; System.out.println("***** result *****"); System.out.println("x = "+ x + ",y = "+ y); System.out.println("a = "+ a + ",b = "+ b); System.out.println("x +=...
Java
package dhtpdud; public class Java_3_7 { public static void main( String[] args ) { int x=10, y=20, ken, boo, yoo, soo; ken = boo = 30; yoo = (ken == boo? x:y); soo = (ken < boo? x:y); System.out.println("***** result ****\n"); System.out.println("yoo = " + yoo + ", soo = " + soo); ...
Java
package dhtpdud; public class Java_3_4 { public static void main(String[] args) { boolean x = true, y = true, z = false; System.out.println("***** result *****\n"); System.out.println("boolean x = true, y = true, z = false"); System.out.println("--- logical AND ---"); System.out.println("x&...
Java
package dhtpdud; public class Java_3_2 { public static void main(String[] args) { int x = 100, y = 30; System.out.println("**** result *****\n"); System.out.println("x + y = " + (x+y)); System.out.println("x - y = " + (x-y)); System.out.println("x * y = " + (x*y)); System.out.println(...
Java
package dhtpdud; public class Java_3_8 { public static void main( String[] args ) { int x, y; float c, d; x = 10; y = 3; c = x/y; d = (float)x/y; System.out.println ("***** result *****\n"); System.out.println ("c == "+c + ",d == "+d); } }
Java
package dhtpdud; public class Java_homework_3_3 { public static void main ( String[] args ) { int sum = 0; int i; for ( i=1; i<=100; i++ ) { if( i%2 == 0 ) sum += i; } System.out.println("total : "+sum); } }
Java
package dhtpdud; public class Java_3_1 { public static void main(String[] args) { int ken = 10, yoo = -20, boo; boo = -yoo; System.out.println("***** result *****\n"); System.out.println("ken = "+ken+","+"yoo = "+yoo+","+"boo = "+boo); System.out.println("++ken = "+(++ken)+", ken = "+ken); Sy...
Java
package dhtpdud; public class Java_4_10 { public static void main ( String[] args ){ int[] ken = {10,20,30,40,50}; int i, ave, sum=0; System.out.println("***** result *****"); for (i=0; i<5; i++) { System.out.println("arr["+i+"] = "+ken[i]); } for (i=0; i<5; i++) { sum +...
Java
package javabook.ch02; class java_ex { public void st(int i, double d, String name) { System.out.print(i+" "); System.out.print(i+d+" "); System.out.println(name); } public void dip(int i) { System.out.println(i); } public void java_exx(int i, double d) { System.out.println(i+d);...
Java
package ControlLayer; import ExceptionsPackage.*; import ModelLayer.*; public class CustomerCtr { private CustomerCon customerCon; public CustomerCtr() { customerCon = customerCon.getInstance(); } public CustomerCon getCustomerCon() { return customerCon; } public void createCustomer...
Java
package ControlLayer; import ExceptionsPackage.*; import ModelLayer.*; public class ItemCtr { private ItemCon itemCon; public ItemCtr() { itemCon = ItemCon.getInstance(); } public void getItem(int id) { itemCon.getItem(id); } public ItemCon getItemCon() { return ite...
Java
package ControlLayer; import ExceptionsPackage.IdNotFoundException; import ExceptionsPackage.MatchingIdException; import ModelLayer.*; public class SaleCtr { private SaleCon saleCon; private ItemCon itemCon; private CustomerCon customerCon; public SaleCtr() { saleCon = saleCo...
Java
package ExceptionsPackage; public class MatchingIdException extends Exception { public MatchingIdException(String text) { super(text); } }
Java
package ExceptionsPackage; public class NumberFormatException extends Exception { public NumberFormatException(String text) { super(text); } }
Java
package ExceptionsPackage; public class MustBeAboveZero extends Exception { public MustBeAboveZero(String text) { super(text); } }
Java
package ExceptionsPackage; public class MustBeANumberException extends Exception { public MustBeANumberException(String text) { super(text); } }
Java
package ExceptionsPackage; public class NullValueException extends Exception { public NullValueException(String text) { super(text); } }
Java
package ExceptionsPackage; public class IdNotFoundException extends Exception { public IdNotFoundException(String text) { super(text); } }
Java
//package GUILayer; // //public class SaleMenu //{ // //}
Java
//package GUILayer; // //public class ItemMenu //{ // //}
Java
//package GUILayer; // //public class CustomerMenu //{ // //}
Java
package ModelLayer; import java.util.ArrayList; public class Sale { private int id; private String regDate; private String status; private double totalPrice; private Customer customer; private BusinessCustomer businessCustomer; private ArrayList<Partsale> partsale; public...
Java
package ModelLayer; import java.util.ArrayList; public class ItemCon { private static ItemCon instance; private ArrayList<Item> itemCon; public static ItemCon getInstance() { if(instance == null) { instance = new ItemCon(); } return instance; } private ItemCon() { itemCon = n...
Java
package ModelLayer; public class Customer extends Person { private String CPRnr; public Customer(int id, String name, String address, String phone, String mail, String CPRnr) { super(id, name, address, phone, mail); this.CPRnr = CPRnr; } public int getId() { ...
Java
package ModelLayer; public class Partsale { private int quantity; private Item item; public Partsale(int quantity, Item item) { this.quantity = quantity; this.item = item; } public int getQuantity() { return quantity; } public It...
Java
package ModelLayer; public class BusinessCustomer extends Person { private String companyName; private String CVRnr; private double discount; public BusinessCustomer(int id, String name, String address, String phone, String mail, String companyName, String CVRnr, double discount) { ...
Java
package ModelLayer; public class Item { private int id; private String description; private String status; private String storage; private double price; public Item(int id, String description, String status, String storage, double price) { this.id = id; this.description = description; this...
Java
package ModelLayer; import java.util.ArrayList; public class CustomerCon { private static CustomerCon instance; private ArrayList<Customer> customerCon; private ArrayList<BusinessCustomer> businessCustomerCon; public static CustomerCon getInstance() { if(instance == null) ...
Java
package ModelLayer; public class Person { private int id; private String name; private String address; private String phone; private String mail; public Person(int id, String name, String address, String phone, String mail) { this.id = id; this.name = name; th...
Java
package ModelLayer; import java.util.ArrayList; import ExceptionsPackage.IdNotFoundException; public class SaleCon { private static SaleCon instance; private ArrayList<Sale> saleCon; public static SaleCon getInstance() { if(instance == null) { instance = new...
Java
package ControlLayer; import ModelLayer.*; /** * Write a description of class CustomerCtr here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class CustomerCtr { private CustomerCon customerCon; public CustomerCtr() { customerCon = customerCon.getIn...
Java
package ControlLayer; import java.util.ArrayList; import ModelLayer.ItemCon; import ModelLayer.Item; import ModelLayer.*; /** * Write a description of class ItemCtr here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class ItemCtr { private ItemCon itemCon; ...
Java
package ControlLayer; import java.util.ArrayList; import ModelLayer.*; // The controller for ALL persons in the system: Customers, Employees and Business Customers; // public class PersonCtr { private Person PersonCon; private ArrayList<BusinessCustomer> businessCon; public PersonCtr() ...
Java
package ControlLayer; import ModelLayer.*; import java.util.ArrayList; /** * Write a description of class SaleCtr here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class SaleCtr { private SaleCon saleCon; private ItemCon itemCon; private CustomerCon custome...
Java
package ModelLayer; import java.util.ArrayList; /** * Write a description of class Sale here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class Sale { private int id; private String regDate; private String status; private double totalPrice; priva...
Java
package ModelLayer; import java.util.ArrayList; /** * Write a description of class ItemCon here. * * @author (your name) * @version (a version number or a date) */ public class ItemCon { private static ItemCon instance; private ArrayList<Item> itemCon; public static ItemCon getIns...
Java
package ModelLayer; /** * Write a description of class Customer here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class Customer extends Person { private String CPRnr; public Customer(int id, String name, String address, String phone, String mail, String C...
Java
package ModelLayer; /** * Write a description of class Partsale here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class Partsale { private int quantity; private Item item; public Partsale(int quantity, Item item) { this.quantity = quanti...
Java
package ModelLayer; /** * Write a description of class BusinessCustomer here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class BusinessCustomer extends Person { private String companyName; private String CVRnr; private double discount; public Bu...
Java
package ModelLayer; /** * Write a description of class Item here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class Item { private int id; private String description; private String status; private String storage; private double price; ...
Java
package ModelLayer; /** * Write a description of class Person here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class Person { private int id; private String name; private String address; private String phone; private String mail; publi...
Java
package ModelLayer; import java.util.ArrayList; /** * Write a description of class SaleCon here. * * @author (your name) * @version (a version number or a date) */ public class SaleCon { private static SaleCon instance; private ArrayList<Sale> saleCon; public static SaleCon getI...
Java
package ModelLayer; import java.util.ArrayList; /** * Write a description of class CustomerCon here. * * @author (your name) * @version (a version number or a date) */ public class personCon() { private static personCon instance; private ArrayList<Person> personCon; private ...
Java
package UiLayer; // Jeppe (note for self): // // Is the following Class necessesary? We will know soon enough... // It seems the mainFrame is instantiated here? Why is that? And if this i a required setup, can we find a more suitable name for the class than "Object"? // // // NOTE: The program compiles wi...
Java
package UiLayer; import java.util.Scanner; /** * Write a description of class MainMenuUI here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class MainMenuUI { //the reference to the ControlLayer private CustomerUI cusUI; private SaleUI saleUI; private ...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.SaleCtr; import java.util.ArrayList; /** * Write a description of class UiSale here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class UiSale { private SaleCtr saleCtr; public UiSale() { ...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.ItemCtr; import ModelLayer.Item; /** * Write a description of class ItemUI here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class ItemUI { private ItemCtr itemCtr; public ItemUI() { ...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.SaleCtr; import java.util.ArrayList; /** * Write a description of class SaleUI here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class SaleUI { private SaleCtr saleCtr; public SaleUI() { ...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.*; /** * Write a description of class CustomerUI here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class CustomerUI { private CustomerCtr cusCtr; //reference to Customer in the ControlLayer private Scan...
Java
package UiLayer; import java.util.Scanner; /** * Write a description of class UiMainMenu here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class UiMainMenu { //the reference to the ControlLayer private UiCustomer cusUI; private UiSale uiSale; private ...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.ItemCtr; import ModelLayer.Item; /** * Write a description of class UiItem here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class UiItem { private ItemCtr itemCtr; public UiItem() { ...
Java
/* GuiHandler() documentation: * * Some function to scale whatever is needed to be scaled in the GUI * Put a frame or whatever "isVisible"-element into the function * -> output will be a new frame just scaled with the input float-parameter (percentage - e.g. float 0.5 = 50 "percent" scaling) * The scaling ...
Java
package UiLayer; import java.awt.*; import javax.swing.border.*; import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; // The SIZE of the GuiMainFrame will be FIXED at a 4:3, as all screen ratios will be able tio show the GuiMainFrame in full size - // Down-scalin...
Java
/* * This class creates a "clean" JTable, with the needed columns, spaced out within the GuiMainFrame. * */ package UiLayer; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.TableColumnModel; import javax.swing.t...
Java
package UiLayer; import java.util.Scanner; import ControlLayer.*; /** * Write a description of class UiCustomer here. * * @author (Gruppe 2) * @version (a version number or a date) */ public class UiCustomer { private CustomerCtr cusCtr; //reference to Customer in the ControlLayer private Scan...
Java
package UiLayer; import java.awt.*; import javax.swing.border.*; import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; // The SIZE of the MainFrame will be FIXED at a 16:9 ratio... "as seen on (most) TVs"... // // The height is 768 pixel // The width is // ...
Java
package ControlLayer; import ExceptionsPackage.*; import ModelLayer.*; public class CustomerCtr { private CustomerCon customerCon; public CustomerCtr() { customerCon = customerCon.getInstance(); } public CustomerCon getCustomerCon() { return customerCon; } public void createCustomer...
Java
package ControlLayer; import ExceptionsPackage.*; import ModelLayer.*; public class ItemCtr { private ItemCon itemCon; public ItemCtr() { itemCon = ItemCon.getInstance(); } public void getItem(int id) { itemCon.getItem(id); } public ItemCon getItemCon() { return ite...
Java
package ControlLayer; public class SaleCtr { }
Java
package ExceptionsPackage; public class MatchingIdException extends Exception { public MatchingIdException(String text) { super(text); } }
Java
package ExceptionsPackage; public class NumberFormatException extends Exception { public NumberFormatException(String text) { super(text); } }
Java
package ExceptionsPackage; public class MustBeAboveZero extends Exception { public MustBeAboveZero(String text) { super(text); } }
Java
package ExceptionsPackage; public class MustBeANumberException extends Exception { public MustBeANumberException(String text) { super(text); } }
Java
package ExceptionsPackage; public class NullValueException extends Exception { public NullValueException(String text) { super(text); } }
Java
package ExceptionsPackage; public class IdNotFoundException extends Exception { public IdNotFoundException(String text) { super(text); } }
Java
//package GUILayer; // //public class SaleMenu //{ // //}
Java
//package GUILayer; // //public class ItemMenu //{ // //}
Java
//package GUILayer; // //public class CustomerMenu //{ // //}
Java
package ModelLayer; import java.util.ArrayList; public class Sale { private String id; private String regDate; private String status; private double totalPrice; private Customer customer; private BusinessCustomer businessCustomer; private ArrayList<Partsale> partsale; pub...
Java
package ModelLayer; import java.util.ArrayList; public class ItemCon { private static ItemCon instance; private ArrayList<Item> itemCon; public static ItemCon getInstance() { if(instance == null) { instance = new ItemCon(); } return instance; } private ItemCon() { itemCon = n...
Java
package ModelLayer; public class Customer extends Person { private String CPRnr; public Customer(int id, String name, String address, String phone, String mail, String CPRnr) { super(id, name, address, phone, mail); this.CPRnr = CPRnr; } public int getId() { ...
Java
package ModelLayer; public class Partsale { private int quantity; private Item item; public Partsale(int quantity, Item item) { this.quantity = quantity; this.item = item; } public int getQuantity() { return quantity; } public It...
Java
package ModelLayer; public class BusinessCustomer extends Person { private String companyName; private String CVRnr; private double discount; public BusinessCustomer(int id, String name, String address, String phone, String mail, String companyName, String CVRnr, double discount) { ...
Java
package ModelLayer; public class Item { private int id; private String description; private String status; private String storage; private double price; public Item(int id, String description, String status, String storage, double price) { this.id = id; this.description = description; this...
Java
package ModelLayer; import java.util.ArrayList; import ExceptionsPackage.IdNotFoundException; public class CustomerCon { private static CustomerCon instance; private ArrayList<Customer> customerCon; private ArrayList<BusinessCustomer> businessCustomerCon; public static CustomerCon getInst...
Java
package ModelLayer; public class Person { private int id; private String name; private String address; private String phone; private String mail; public Person(int id, String name, String address, String phone, String mail) { this.id = id; this.name = name; th...
Java
package ModelLayer; import java.util.ArrayList; public class SaleCon { private static SaleCon instance; private ArrayList<Sale> saleCon; public static SaleCon getInstance() { if(instance == null) { instance = new SaleCon(); } return instance; ...
Java
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
Java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
Java
/* * Copyright 2013 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java
/* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
Java