d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > User Blogs > 100 Days Of Programming Challenge. > Java
Prev123
Add Reply New Topic
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 29 2017 06:26pm
Code
public boolean sleepIn(boolean weekday, boolean vacation) {
if (!weekday || vacation) {
return true;
}

return false;
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 29 2017 07:02pm
Code
import java.util.Scanner;

public class excercise5 {
Scanner in = new Scanner(System.in);
System.out.print(" Input first number : );
int num1 = in.nextInt();

System.out.print("Input second number: );
int num2 = in.nextInt();
System.out.println (num 1 + "x" +num2 + "=" + num1 * num2);
}
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 31 2017 01:16am
Code
struct MyStruct
{
//fields
private int x, y;
private AnotherClass myClass;
private Days mydays;
//constructor
public myStruct(int a, int b, intc)
{
myClass = new AnotherClass();
myClass.number = a;
x = b ;
y = c;
myDays = Days.Mon;
}
//method
public void printStatement()
{
Console.WriteLine("x = {0}, y = {1}, myDays = {2}", x, y, myDays);WriteLine("x = {0}, y = {1}, myDays = {2}", x, y, myDays);WriteLine("x = {0}, y = {1}, myDays = {2}", x, y, myDays);WriteLine("x = {0}, y = {1}, myDays = {2}", x, y, myDays);
}
}
class AnotherClass {
public int number;
}
enum Days {Mon, Tues, Wed }

}
}

}


This post was edited by Morphed on Oct 31 2017 01:16am
Go Back To User Blogs Topic List
Prev123
Add Reply New Topic