Welcome to Dream.In.Code
Become a Java Expert!

Join 150,363 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,814 people online right now. Registration is fast and FREE... Join Now!




Java Program clean up suggestions

 
Reply to this topicStart new topic

Java Program clean up suggestions, Weekly Pay (very weakly)

bostonrob
3 Feb, 2008 - 09:24 AM
Post #1

New D.I.C Head
*

Joined: 15 Nov, 2007
Posts: 6


My Contributions
Hello

(Hey Matyr) I just got back from Survivor and enjoying my time off with my Hot wife smile.gif
Anyway!
I was a happy visitor of the Javascript forum and have now graduated to Java.
I have made my Program it works good enough for my homework.
I would just like someone to review it and make sure I start off on the right foot.
I didnt understand why I could only get one zero after the decimal I had to fudge it.
I was able to make the TextIO.java work but I dont understand why it wont give me the zero.
Well anywho I did everything I could before I posted so be easy.
Catch you on the Island.

CODE


/*
* WeeklyPay.java
*
* Created on February 3, 2008, 12:57 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

/**
*
* @author Dad
*/
public class YoungWeeklyPay {
    
    /** Creates a new instance of WeeklyPay */
    public WeeklyPay() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // Declare Variables
        
        int  hours =   0;    //Variable Hold for User input hours worked
        double level = 0;   //Variable Hold For user input Level Number
        double temp =  0;      //Variable holder for calculation
        
        
        System.out.println("Please enter Hours worked! "); //user input hours worked
        hours = TextIO.getlnInt();
      
      
        System.out.println("Please enter your Level  "); // User input Level of Employee
        temp = TextIO.getInt();
        
        if (temp == 1) level = 8;         //begin If Statement
         else if (temp == 2) level =10;
        if (temp == 3) level =12;        // End If Statement
                
        System.out.println("Your Weekly pay is $"+ hours*level+0 ); //Final output of Calculation
    }
    
}


This post has been edited by bostonrob: 3 Feb, 2008 - 01:01 PM
User is offlineProfile CardPM
+Quote Post

GWatt
RE: Java Program Clean Up Suggestions
3 Feb, 2008 - 12:41 PM
Post #2

human inside
Group Icon

Joined: 1 Dec, 2005
Posts: 2,360



Thanked: 31 times
Dream Kudos: 500
My Contributions
For the love of god. . .
code.gif

User is online!Profile CardPM
+Quote Post

bostonrob
RE: Java Program Clean Up Suggestions
3 Feb, 2008 - 12:54 PM
Post #3

New D.I.C Head
*

Joined: 15 Nov, 2007
Posts: 6


My Contributions
If you look! I followed the Instructions And put the code and code/ at the beginning and end just like it said.
So instead of negative help explain your self I bet you were a newb once.
No disrespect intended
After looking at your reply I noticed the [] .
Fixed

Rob




QUOTE(GWatt @ 3 Feb, 2008 - 01:41 PM) *

For the love of god. . .
code.gif


This post has been edited by bostonrob: 3 Feb, 2008 - 01:03 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 01:49PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month