The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I have done this much with my program and need to find out how to make a console where I can add a number into the numbers and give me a total answer.  Need an good explanation. I have attached what I have started in Java.Â
Â
/** To change this license header, choose License Headers in Project Properties.* To change this template file, choose Tools | Templates* and open the template in the editor.*/package pkgpackage.sales;import java.text.NumberFormat;/**** @author John Vanderdrink*/public class PackageSales {/*** @param args the command line arguments*/public static void main(String[] args){//Start of Main MethodSystem.out.println(" Welcome to Salesperson Commission Program");//Welcome message.System.out.println("");//Hard Numbersdouble salary =30000;//Fixed annual salary of$30,000 a year.double commission = .08;//Commission is 8%double yearlysales=;//Have to be able to add anumber to this via the console.Dont know how.double compensation = yearlysales + commission;double annual = salary +compensation;//Annual Income with salescommission.//Apply Currency format.NumberFormat currency = NumberFormat.getCurrencyInstance();String salaryFormatted = currency.format(salary);String yearlysalesFormatted = currency.format(yearlysales);String compensationFormatted = currency.format(compensation);String annualFormatted = currency.format(annual);//Display OutputString message =" Salary " + salaryFormatted + "\n"+" Yearly Sales " + yearlysalesFormatted + "\n" +" Commission " + compensationFormatted + "\n" +" Annual Salary with Commission " + annualFormatted;System.out.println(message);//Goodbye MessageSystem.out.println(" Thank you for using the Salesperson CommissionProgram");}}
-----------