top of page
Legion of Learners
www.lol-101.com
Home
Classrooms
Courses
About Us
Executive Team
Board Members
Resources
Members
More
Use tab to navigate through the menu items.
Log In
Forum Comments
2.7 What are flow control structures?
In Introduction to Java
brianlin2025
Jun 16, 2019
//I'm using eclipse import java.util.Scanner; public class ifelse { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("How much money is in the bank account?"); int money = scanner.nextInt(); System.out.println("What is the annual interest rate?"); double interest = scanner.nextDouble(); System.out.println("How many years are you waiting?"); int years = scanner.nextInt(); double bank = money * interest * years + money; System.out.println("The account balance is " + bank); if (bank > 5000) { System.out.println("You're rich!"); } else { System.out.println("You need to invest more you nublet"); } if (bank >= 1000000) { System.out.println("You're a millionare!"); } } }
0
0
B
brianlin2025
0
Followers
0
Following
Follow
Following icon
More actions
Profile
Forum Comments
Forum Posts
More
Use tab to navigate through the menu items.
bottom of page