Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Obstkorb {
- public Obstkorb(int anzahlObstsorten) {
- //Hier leg ich die anzahl der Früchte an die die jeweilige Obstsorte hat
- int[] arrayobstsorten = {anzahlObstsorten};
- for(int i = 0; i<arrayobstsorten.length-1; i++) {
- arrayobstsorten[i] = anzahlObstsorten -i;
- }
- //Hier leg ich den Preis fest für die jewelige Obstsorte
- int[] obstsortenpreis = {anzahlObstsorten};
- for(int j = 0; j<obstsortenpreis.length -1; j++) {
- if(j == 0) {
- obstsortenpreis[j] = (anzahlObstsorten - j) * 1;
- }
- obstsortenpreis[j] = (anzahlObstsorten - j) * j;
- }
- }
- public static int verkaufe(int sorte, int anzahl) {
- arrayobstsorten[sorte-1] = arrayobstsorten[sorte-1] - anzahl;
- }
- public static int neuerPreis(int sorte, int preis) {
- }
- public static void printUmsatz() {
- }
- public static void main(String[]args) {
- Obstkorb k = new Obstkorb(20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement