Program 1
void main() {
int apples = 7;
IO.println("We have " + apples + " apples.")
}
Program 2
void main() {
String name = "Alice;
IO.println("Hello, " + name);
}
Program 3
void main() {
int cats = 3;
int dogs = 4;
IO.println("Total pets: " + (cats + dogs);
}
Program 4
void main() {
int score = 95;
if (score > 90) {
IO.println("Great job!");
}
Program 5
void main() {
itn pizzas = 4;
int slices = pizzas * 8
IO.println(slices + " slices in all.");
}
Program 6
void main() {
int year = 2026;
IO.println("The year is + year);
IO.println("Almost done!";
}
Program 7
void main() {
int temp 45;
if (temp < 60 {
IO.println("Wear a jacket.");
}
}
Program 8
viod main() {
int laps = 10
int miles = laps / 4;
IO.println("You ran " + miles + " miles.);
}
Program 9
void main() {
int red = 5;
int blue = 3
IO.println("Red: " + red;
IO.println("Blue: + blue);
}
Program 10
void main() {
int count = 5;
IO.Println("Count: " + count)
IO.println("Done!);
}
Program 11
void main() {
int width = 8;
int height 6;
int area = width * height
IO.println("Area: + area);
Program 12
viod main() {
int coins = 25
if coins > 10) {
IO.println("You're rich!";
}
}