Results 1 to 2 of 2
Thread: Pleas anyone can help me?
- 06-02-2012, 06:40 PM #1
Member
- Join Date
- Jun 2012
- Posts
- 3
- Rep Power
- 0
Pleas anyone can help me?
Hi all,
I need help in this i have a mail class and a varable called commision( commision is calculated value). i need move this value to another class to print it. but i no have the form.
Main class code:
And this is the second class:Java Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Neowolf */ import java.util.Scanner; public class Week2 { /** * @param args the command line arguments * */ double link; public double showInfo() { return link; } public static void main(String[] args) { // TODO code application logic here Week2class myWeek2class = new Week2class();//call the class Week2class Scanner input = new Scanner(System.in);//create the input variable from the Scanner int AnnualSales;//declare variables int Salary; double Commision; // Validate the input is a integer and a positive value do { System.out.println("Please enter a Annual Sales"); while (!input.hasNextInt()) { System.out.println("That's not a valid value!"); input.next(); // this is important! } AnnualSales = input.nextInt(); } while (AnnualSales <= 0); // Validate the input is a integer and a positive value do { System.out.println("Please enter a Salary"); while (!input.hasNextInt()) { System.out.println("That's not a valid value!"); input.next(); // this is important! } Salary = input.nextInt(); } while (Salary <= 0); Commision = Salary + (AnnualSales * .08); System.out.println(Commision); myWeek2class.displayMessage(); } }
ThanksJava Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Neowolf */ public class Week2class { public void displayMessage() { Week2 Commision = new Week2(); System.out.print("Commision and Salary Total is $"); System.out.println(Commision.showInfo()); } }
- 06-02-2012, 09:01 PM #2
Re: Pleas anyone can help me?
Also posted at: Help with a varibles!
If you don't understand my response, don't ignore it, ask a question.
Similar Threads
-
Data extraction, pleas help!!
By bob nash in forum New To JavaReplies: 1Last Post: 05-04-2011, 08:09 AM -
Java Calculator Square Root Pleas Help
By TommyR in forum Advanced JavaReplies: 6Last Post: 02-03-2011, 03:28 PM -
Pleas help me
By Smile in forum Java AppletsReplies: 2Last Post: 04-23-2010, 01:18 PM -
New here, pleas help!
By prairie_hoops in forum New To JavaReplies: 4Last Post: 10-29-2009, 07:33 AM -
Pleas help on finding errors
By McXxT in forum New To JavaReplies: 6Last Post: 04-02-2009, 08:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks