Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class gallon2Liters {
- public static void main(String[] args){
- double gallons;
- double liters;
- int counter = 100;
- for (int i = 1; i < counter; i++){
- gallons = i;
- liters = gallons * 3.7854;
- System.out.println(gallons + " gallons is " + liters + " liters");
- if(i%10 == 0){
- System.out.println("");
- }
- }
- }
- }
- public class teefee {
- public static void main(String[] args) {
- teeFee(30);
- }
- public static void teeFee(int x){
- for (int i = 1; i <= x; i++) {
- boolean teeOrFee = false;
- if (i % 3 == 0) {
- System.out.print("T");
- teeOrFee = true;
- }
- if (i % 5 == 0) {
- System.out.print("F");
- teeOrFee = true;
- }
- if (teeOrFee) {
- System.out.println();
- } else {
- System.out.println(String.valueOf(i));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement