Java za mlade programere (1) - Tutoriali.org
Java za mlade programere (1) - Tutoriali.org
Java za mlade programere (1) - Tutoriali.org
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
total = deposit * weeks;System.out.println("\n" + yourName + ", after " +weeks + " weeks, you will have $" + total + " in yoursavings.\n");Snimite projekt klikom miša na dugme Save All.Konačan kôd u prozoru Jcreatora trebalo bi da ima sledećioblik:/** Savings Project* <strong>Java</strong> for Kids*/public class Savings{public static void main(String[] args){// declare and initialize variablesString yourName;double deposit = 0.0;int weeks = 0;double total = 0.0;// ask user nameyourName = Typeit.inString("Hello, what is yourname?");// get deposit amountdeposit = Typeit.inDouble("\nHow much will youdeposit each week?");// get number of weeksweeks = Typeit.inInt("For how many weeks?");// compute and display totaltotal = deposit * weeks;