DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Need help coding first program

    Trying to write a source code for total cost of shirts.


    The total cost of shirts is determined by the following formula:

    if number of shirts is greater than 15

    costPerShirt = 5.50

    if number of shirts is less than 15

    costPerShirt = 8.50

    The program must output the total cost for 1 to 10 shirts.

    I am suppose to use if else statement and loop, can anyone help me with this or give me reference to use for help. My first program.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Posts
    313
    The java spec for if and loop statements are at:
    If: http://java.sun.com/docs/books/tutor...dbolts/if.html
    For Loop: http://java.sun.com/docs/books/tutor...bolts/for.html

    Hope these help.
    ~evlich

Similar Threads

  1. Help with a program
    By stormswimmer in forum Java
    Replies: 2
    Last Post: 01-02-2006, 03:17 PM
  2. problem in program in c++
    By mheasen in forum Architecture and Design
    Replies: 0
    Last Post: 03-20-2002, 09:24 AM
  3. Please help with running executable vb program.
    By Gordon Reichhardt in forum VB Classic
    Replies: 2
    Last Post: 01-08-2002, 10:06 AM
  4. How can I build copy protection into my program
    By W.Pierce in forum VB Classic
    Replies: 1
    Last Post: 12-11-2001, 08:28 AM
  5. Replies: 0
    Last Post: 12-15-2000, 10:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links