hey /g/uy's i need a little help with this code for my coding class
java. I dont know the code to be able to type in a persons name
i need to input a person's name then be able to press enter and input a numbe
import java.util.Scanner;
public class Taxes{
public static void main(String[] args){
double net;
Scanner input = new Scanner(System.in);
System.out.println("Enter employee name: ");
System.out.println("Enter employee gross pay: ");
name = input.nextDouble();
final double fed = grossPay * .15;
final double state = grossPay * .035;
final double social = grossPay * .0575;
final double medicare = grossPay * .0275;
final double pension = grossPay * .05;
final double health = 75.00;
net = grossPay - fed - state - social - medicare - pension - health;
System.out.println("\t Gross Amount: " + grossPay + "\n" +
"\t Federal Tax: " + fed + "\n" +
"\t State Tax: " + state + "\n" +
"\t Social Security Tax: " + social + "\n" +
"\t Medicare/Medicaid Tax: " + medicare + "\n" +
"\t Pension Plan: " + pension + "\n" +
"\t Health Insurance: $" + 75 + "\n" +
"\t Net Pay: $" + net + "\n");
}
}
sorry that I just copied my thread from there to here without thinking to change anything, I thought you would be accepting of my because I had a coding issue that you might take pity upon. but now I see you are nothing but an old man who is not willing to help a new hero take up the fight. all in all fuck you
>>1
What you are looking for is the Scanner method called nextLine(). Don't forget that, if you're using it after inputting a number, for instance, you will have to call it once to get to the end of the current line (you may safely discard the result) and another time to actually fetch the contents next line. Basically, what the nextLine() it does is return all the characters until the end of the line. I hope this HELPED.
>>25
Probably he's in College somewhere, hacking away at U MENA HASKELL, and has had little or no exposure to the languages or methodologies that real programming is done in.
instance (E y y', A (F x) y' r) => E ((F x) :< y) r
instance (E (x :< y) r', E (r' :< z) r) => E ((x :< y) :< z) r
-- Fixed point combinator
data Rec l
instance E (l :< (F (Rec l)) :< x) r => A (F (Rec l)) x r
-- Peano numbers
data Zero = Zero
data Su a = Su a
type N0 = Zero
type N1 = Su N0
type N2 = Su N1
type N3 = Su N2
type N4 = Su N3
type N5 = Su N4
instance E Zero Zero
instance E x x' => E (Su x) (Su x')
data FSum'
instance A (F FSum') self (F (FSum',self))
instance A (F (FSum',self)) n (F (FSum',self,n))
instance A (F (FSum',self,Zero)) m m
instance E (self :< n :< m) r => A (F (FSum',self,(Su n))) m (Su r)
type FSum = Rec (F FSum')
data Fib'
instance A (F Fib') self (F (Fib',self))
instance A (F (Fib',self)) Zero (Su Zero)
instance A (F (Fib',self)) (Su Zero) (Su Zero)
instance E (F FSum :< (self :< n) :< (self :< (Su n))) r => A (F (Fib',self)) (Su (Su n)) r
type Fib = Rec (F Fib')
-- Compute fib(5). Type ":type fib5" in ghci to see the result.
fib5 :: E (F Fib :< N5) r => r
fib5 = undefined
Haskell represents the completemost example of unrestrained
aestheticism and flamboyant homosexuality in the area of programming
language research, Apollonian beauty taken to the absolute, a perfect
composition of regular, clean, well-defined syntax with just enough
tastefully introduced peculiarities to make it express and define
the relationship between God and Man.
It is a work of finest art, started by divine spark and carried out
by tender and sensitive hands of the sculptor.