This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * BitOutputStream.class | |
| */ | |
| package chapter.pkg17; | |
| import java.io.*; | |
| /** | |
| * | |
| * @author Marcello | |
| */ | |
| public class BitOutputStream { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package Ch16Exercises; | |
| import javafx.application.Application; | |
| import javafx.scene.Scene; | |
| import javafx.scene.shape.*; | |
| import javafx.scene.paint.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package ch15exercises; | |
| import javafx.scene.control.Button; | |
| import javafx.scene.layout.HBox; | |
| import javafx.application.Application; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * To change this license header, choose License Headers in Project Properties. | |
| * To change this template file, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package ch14exercises; | |
| //import java.io.File; | |
| //import java.awt.Transparency; | |
| import javafx.application.Application; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.ArrayList; | |
| public class MyStack13 { | |
| private ArrayList<Object> list = new ArrayList<>(); | |
| public boolean isEmpty() { | |
| return list.isEmpty(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.io.*; | |
| /* | |
| Implement the sieve of Eratosthenes: a method for computing | |
| prime numbers, known to the ancient Greeks. This method will | |
| compute all prime numbers up to n. Choose an n. First insert | |
| all numbers from 2 to n into a set. Then erase all multiples | |
| of 2 (except 2); that is, 4, 6, 8, 10, 12, … . Erase all | |
| multiples of 3; that is, 6, 9, 12, 15, … . Go up to n. Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| *@author Marcello Liguori | |
| */ | |
| //Write a program whose input is the number n and whose | |
| //output is the magic square of order n if n is odd. | |
| /* | |
| Test case: 5 | |
| Output... | |
| 11 18 25 2 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class TXP_Exercises | |
| { | |
| /* Diamond algorithm - by Marcello Liguori | |
| */ | |
| public static void main(String[] args) | |
| { | |
| Scanner in = new Scanner(System.in); | |
| System.out.print("Enter a number: "); // length of diamond sides |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| import java.util.ArrayList; | |
| /** | |
| * Takes string and integer input from user and outputs bar graph. | |
| *@author Marcello Liguori | |
| * | |
| *Example: USA Japan 2 3 | |
| * | |
| * USA: ** | |
| * Japan: *** |
NewerOlder