Commit 39d1b9ca authored by Charlotte Kerr's avatar Charlotte Kerr

Changes to code

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>week03</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
package week03;
import java.util.Scanner;
public class expressions {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
int a = 2, b = 2, c = 2, d = 2, e = 2, f = 2, x = 3;
System.out.println("a++ = " + (a++));
System.out.println("b-- = " + (b--));
System.out.println("c+=b = " + (c+=b));
System.out.println("d-=b = " + (d-=b));
System.out.println("e*=b = " + (e*=b));
System.out.println("f/=b = " + (f/=b));
System.out.println("5%3 = " + (5%3));
Scanner input = new Scanner(System.in);
System.out.println("Enter the numerator:");
int num1 = input.nextInt();
System.out.println("Enter the denominator:");
int num2 = input.nextInt();
if ((num1%num2)==0) {
System.out.println("Your numerator is divisible.");
}
else {
System.out.println("Your numerator is not divisible.");
}
*/
System.out.println("Enter your first number:");
int num3 = input.nextInt();
System.out.println("Enter your second number:");
int num4 = input.nextInt();
*/
System.out.println("Multiples of 3 from 31 to 0.");
System.out.println();
for(int i = 31; i >= 1; i--) {
if(i%3 != 0) {
continue;
}
System.out.println(i);
}
for(int i=1; i<=10; i++) { // Only shows numbers 1-5.
if(i>5)break;
System.out.println(i);
}
for(int i=1; i<=10; i++) { // Only shows numbers 6-10.
if(i<=5) {continue;}
System.out.println(i);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment