Lab 5
This commit is contained in:
BIN
lab4_CalebFontenot/PDFs/lab4-1 edit.pdf
Normal file
BIN
lab4_CalebFontenot/PDFs/lab4-1 edit.pdf
Normal file
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class ABCD {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int ABCD = 1234;
|
||||
System.out.println(ABCD % 100);
|
||||
}
|
||||
}
|
@@ -5,6 +5,8 @@
|
||||
|
||||
package com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
@@ -12,13 +14,21 @@ package com.calebfontenot.lab4_calebfontenot;
|
||||
public class Lab4_CalebFontenot {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
int i = 11,
|
||||
j = 22;
|
||||
double x = 11.11,
|
||||
y = 22.22;
|
||||
// Setup Scanner;
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
System.out.println("\n" + i + " + " + j + " = " + (i + j));
|
||||
System.out.println("\n" + x + " + " + y + " = " + (x + y));
|
||||
System.out.println("Enter i, j, x, and y: ");
|
||||
int i = input.nextInt();
|
||||
int j = input.nextInt();
|
||||
double x = input.nextDouble();
|
||||
double y = input.nextDouble();
|
||||
//int i = 11,
|
||||
// j = 22;
|
||||
//double x = 11.11,
|
||||
// y = 22.22;
|
||||
|
||||
// Changed addition to division
|
||||
System.out.println("\n" + i + " / " + j + " = " + (i / j));
|
||||
System.out.println("\n" + x + " / " + y + " = " + (x / y));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user