Skip to main content

Section 5.6 Java

Activecode now supports Java, C++ and C through a backend server, not in the browser. You can use them by specifying the language to be java, cpp or c In addition it supports either Python3 or Python2 outside of the browser using python3 or python2 as the language. You are limited to non-graphical programs in any of these options.

Hint.
.. activecode:: lc1
            :language: java
            :stdin: 100

            import java.util.Scanner;

            public class TempConv {
            public static void main(String[] args) {
            Double fahr;
            Double cel;
            Scanner in;

            in = new Scanner(System.in);
            System.out.println("Enter the temperature in F: ");
            fahr = in.nextDouble();

            cel = (fahr - 32) * 5.0/9.0;
            System.out.println(fahr + " degrees F is: " + cel + " C");

            System.exit(0);
            }

            }
You have attempted of activities on this page.