pokemasterflex
09-28-2008, 05:11 PM
I can't figure out why my code will not compile correctly.
The object of the program is as follows.
Let's assume that a lucky person has just won a 75 million dollar jackpot. The jackpot will be paid out in a 25-year installment. You are to write a Java program to do the following:
Ask the user to enter the name of hte lucky winner
Calculate the amount of annual payment ot the winner (your program must declae oth the amount of the jackpot and the number of payments as named constants)
Output the winner's name and the amount of payment that he or she will recieve annually
Im using the compiler found in Programming and Problem Solving With Java. Second Edition by Neil Dale and Chip Wems
I've written my code accordingly. Is there something that you guys see that I did wrong? Any input you have is very appreciated. Thanks
//*********************************************************************************************
// Author: Chris Arcell
// Input: A $75,000,000 jackpot that is paid out in istallments over 25 years, and the winners name
// Processing: Ask the user to input their name, and calculate the payments for the 25 years
// Output: The lucky winners name as well as the annual payment
//*********************************************************************************************
import java.util.Scanner;
public class Lucky_Winner
{
String name; System.out.print(“Enter your name: ”); name = indata.nextLine(); } //Prompts the use for their name
""
{ final int "YEARS"=25; //The years in which the jackpot is to be paid out
final long "JACKPOT"=75000000; //Jackpot amount
char dollar_sign='$'; //character to show the jackpot as a monetary value
}
""
{ String name; System.out.print("The Lucky Winner Is:"name"); name = indata.nextLine();""//Prints the input the user specified at the beginning of the program
}
{String name; System.out.print("The Jackpot Amount Is:"JACKPOT"); name = indata.nextLine();""//Prints the jackpot amount
{string name; System.out.print("The Annual Payment Is:"3000000"
char dollar_sign='$'; //character to show the jackpot as a monetary value
The object of the program is as follows.
Let's assume that a lucky person has just won a 75 million dollar jackpot. The jackpot will be paid out in a 25-year installment. You are to write a Java program to do the following:
Ask the user to enter the name of hte lucky winner
Calculate the amount of annual payment ot the winner (your program must declae oth the amount of the jackpot and the number of payments as named constants)
Output the winner's name and the amount of payment that he or she will recieve annually
Im using the compiler found in Programming and Problem Solving With Java. Second Edition by Neil Dale and Chip Wems
I've written my code accordingly. Is there something that you guys see that I did wrong? Any input you have is very appreciated. Thanks
//*********************************************************************************************
// Author: Chris Arcell
// Input: A $75,000,000 jackpot that is paid out in istallments over 25 years, and the winners name
// Processing: Ask the user to input their name, and calculate the payments for the 25 years
// Output: The lucky winners name as well as the annual payment
//*********************************************************************************************
import java.util.Scanner;
public class Lucky_Winner
{
String name; System.out.print(“Enter your name: ”); name = indata.nextLine(); } //Prompts the use for their name
""
{ final int "YEARS"=25; //The years in which the jackpot is to be paid out
final long "JACKPOT"=75000000; //Jackpot amount
char dollar_sign='$'; //character to show the jackpot as a monetary value
}
""
{ String name; System.out.print("The Lucky Winner Is:"name"); name = indata.nextLine();""//Prints the input the user specified at the beginning of the program
}
{String name; System.out.print("The Jackpot Amount Is:"JACKPOT"); name = indata.nextLine();""//Prints the jackpot amount
{string name; System.out.print("The Annual Payment Is:"3000000"
char dollar_sign='$'; //character to show the jackpot as a monetary value