Skip to content

Instantly share code, notes, and snippets.

@davidalves1
Created August 2, 2018 12:38
Show Gist options
  • Save davidalves1/6f0314250a6ad4f18e6f43c63c0951e0 to your computer and use it in GitHub Desktop.
Save davidalves1/6f0314250a6ad4f18e6f43c63c0951e0 to your computer and use it in GitHub Desktop.
Exercises JAVA Audacity
class Playground {
public static void main(String[ ] args) {
// Exercise 3
int bankBalance = 500;
bankBalance += 250;
bankBalance -= 100;
System.out.println(bankBalance);
// Exercise 5
int day = 8;
String month = "March";
System.out.println("My birthday is " + day + " of " + month);
// Exercise 6
String firstName = "David";
String lastName = "Alves";
String fullName = firstName + " " + lastName;
int letters = firstName.length() + lastName.length();
System.out.println("Hi, my name is " + fullName + ". My name have " + letters + " letters.");
// Exercise 7
double f = 81;
double c = (f - 32) * 5 / 9;
System.out.println("The celsius value of " + f + " farenheit is " + c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment