/* * Intro to Programming CSE 1310 * University of Texas at Arlington */ package code22jan19; import java.util.Scanner; /** * * @author jcmtiernan */ public class Code22Jan19 { /** * @param args the command line arguments */ public static void main(String[] args) { int a; int resultInt; double resultDouble; Scanner input = new Scanner(System.in); String myStr = new String(); String myLine = new String(); a = 10; resultInt = -a; System.out.println("resultInt = "+resultInt); /* System.out.print("Please enter an integer: "); //a = input.nextInt() ; resultInt = a; System.out.println("resultInt from user = "+resultInt); System.out.print("\nPlease enter a floating point number: "); resultDouble = 10; //input.nextDouble(); System.out.println("You entered : "+resultDouble); */ /* System.out.println("\nPlease enter a string! "); myStr = input.next(); System.out.println("You entered the string *"+myStr+"*"); String leftoverStuff = input.nextLine(); System.out.println("This was cleaned out of the input buffer #"+leftoverStuff); System.out.println("\n\nPlease enter a string! "); myLine = input.nextLine(); System.out.println("You entered the string *"+myLine+"*"); */ // equation for slope // y = mx + b double y = 0, m = 0, x = 0, b = 0; // y,m = 0 y = m * x + b; // finding the y-intercept m = (y - b)/ x; // finding slope System.out.println("Using y = mx + b to get m =" + m); } }