Commit 3a255f9d authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

README.md

0 → 100644
+15 −0
Changes for README.md: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
## Example files for the title:  
  
# Beginners Java Programming, by Mike McMillan
  
[![Beginners Java Programming, by Mike McMillan](http://akamaicovers.oreilly.com/images/9781926873565/cat.gif)](https://www.safaribooksonline.com/library/view/title/9781926873565//)
  
The following applies to example files from material published by O’Reilly Media, Inc. Content from other publishers may include different rules of usage. Please refer to any additional usage rights explained in the actual example files or refer to the publisher’s website.
  
O'Reilly books are here to help you get your job done. In general, you may use the code in O'Reilly books in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from our books does not require permission. Answering a question by citing our books and quoting example code does not require permission. On the other hand, selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Incorporating a significant amount of example code from our books into your product's documentation does require permission.
  
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN.
  
If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at <permissions@oreilly.com>.
  
Please note that the examples are not production code and have not been carefully testing. They are provided "as-is" and come with no warranty of any kind.
+7 −0
Changes for WORKING_FILES/Chapter 1/No Work Files.rtf: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 No work files for this lesson...}
 No newline at end of file
+12 −0
Changes for WORKING_FILES/Chapter 10/Chap10Part1.java: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
public class Chap10Part1
{
   public static void main(String[] args) 
   {
      int num = 12;
      System.out.println(num + " squared equals " + square(num));     
   }

   static int square(int number) {
      return number * number;
   }
}
 No newline at end of file
+21 −0
Changes for WORKING_FILES/Chapter 10/Chap10Part2.java: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
import java.util.Scanner;

public class Chap10Part2
{
   public static void main(String[] arts) 
   {
      
   }
   
   static double ftoc(double temp) {
      double celsius;
      celsius = (temp - 32.0) * (5.0 / 9.0);
      return celsius;
   }

   static double ctof(double temp) {
      double fahrenheit;
      fahrenheit = temp * (9.0 / 5.0) + 32.0;
      return fahrenheit;
   }
}
 No newline at end of file
+38 −0
Changes for WORKING_FILES/Chapter 10/Chap10Part3.java: 38 added lines, 0 removed lines.
Original line number Diff line number Diff line
import java.util.Scanner;

public class Chap10Part3
{
   public static void main(String[] arts) 
   {
      Scanner inputTemp = new Scanner(System.in);
      Scanner input = new Scanner(System.in);
      double temperature;
      String type;
      System.out.print("Enter a temperature to convert: ");
      temperature = inputTemp.nextDouble();
      System.out.print("Enter type to convert to (C or F): ");
      type = input.next();
      System.out.println("The converted temperature is " + 
                         convert(temperature, type));
   }
   
   static double ftoc(double temp) {
      double celsius;
      celsius = (temp - 32.0) * (5.0 / 9.0);
      return celsius;
   }

   static double ctof(double temp) {
      double fahrenheit;
      fahrenheit = temp * (9.0 / 5.0) + 32.0;
      return fahrenheit;
   }

   static double convert(double temp, String type) {
      if (type.equals("C"))
         return (temp - 32.0) * (5.0 / 9.0);
      else
         return temp * (9.0 / 5.0) + 32.0;
   }

}
 No newline at end of file
Loading