d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > User Blogs > 100 Days Of Programming Challenge. > Java
Prev123Next
Add Reply New Topic
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 22 2017 03:19am
Code
public class ElseAnd if
{
public static void main (String[] args)
{
int people = 30;
int cars = 40;
int buses = 15;

if (cars > people )
{
System.out.println (" we should take the cars.");
}

else if (cars < people )
{
System.out.println( "we should not take the cars.");
}

else
{
System.out.println ( " we cant decide ");
}

if ( buses > cars )
{
System.out.println( "maybe we could take the buses ");
}

else {
System.out.println ("we still cant decide ");
}

if (people > buses )
{
System.out.println("alright lets just take the busses");
}
Else {
System.out.println ("Fine ,lets stay home then");
}

}
}
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 23 2017 01:05am
Code
class Dog {

int age;

public Dog(int dogsAge) {

age = dogsAge;

}
public void bark() {
System.out.println("woof!");
}
public static void main(String[] args) {

Dog spike = new Dog(5);
spike.bark();
}

}
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 23 2017 04:38pm
milestone:Made 25 Java programs
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 23 2017 11:59pm
Code
import java.util.Scanner;

public class ReadingIntegers {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);

System.out.print("Austin Carstens");
String name = reader.nextLine();

System.out.print("How are you" );
int age = Integer.parseInt(reader .nextLine());
System.out.println("Your name is: " + name + ", and you are " + age + " years old, nice to meet you!");




This post was edited by Morphed on Oct 24 2017 12:01am
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 24 2017 12:34am
Code
import java.util.Scanner;
public class Circumference {
public static void main(String [] args) {
Scanner reader = new Scanner (System.in);

System.out.println("Type the radius");
int radius = Integer.parseInt(reader.nextLine());

System.out.println("the circumference of a circle:" + radius * 2 * Math.PI);
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 24 2017 02:29am
Code
import java.util.Scanner;
public class AgeCheck {
public static void main(String[] args) {

Scanner reader = new Scanner(System.in);
System.out.print("How old are you?");
int age = Integer.parseInt(reader.nextLine());
if (age > 0 && age < 120) {
System.out.print("Ok");
} else {
System.out.println("Impossible");
}




Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 25 2017 04:14pm
pretty much got the basics down in java
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 27 2017 09:19pm
reading the software developers career guide
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 28 2017 12:13am
read 250 pages
Member
Posts: 11,849
Joined: Apr 21 2008
Gold: 572.25
Oct 28 2017 01:37pm
import java.util.ArrayList;

public class TemperaturesB {

public static void main(String[] args) {

ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();
weeklyTemperatures.add(78);
weeklyTemperatures.add(67);
weeklyTemperatures.add(89);
weeklyTemperatures.add(94);

Go Back To User Blogs Topic List
Prev123Next
Add Reply New Topic