// I seem to be having a problem when I run the program it doesnt come up line for line, I get one line then two lines in a row. I want to know how to make it so I input the test data request after request.
import java.util.Scanner;
public class M_C_LotteryWinnings
{
public static void main(String[] args)
{
System.out.println ("Welcome to Michael's pooled Lottery Winnings Calculater. \n");
Scanner keyboard = new Scanner( System.in );
System.out.println ( "Enter The Lottery Name:" );
String name = keyboard.next();
System.out.println ( "Enter the number of people in your lottery pool:" );
String people = keyboard.next();
System.out.println ( "Enter the total number of tickets purchased:" );
int Tickets = keyboard.nextInt();
if( Tickets % 100 != 0 )
System.out.println( "Number of tickets must be a multiple of People in pool." );
System.out.println ( "Enter the total number of tickets purchased:" );
System.out.println ( "Enter the combined winnings on all tickets:" );
int winnings = keyboard.nextInt();
System.out.println ( "Enter the per-ticket Purchase Price:" );
double price = keyboard.nextDouble();
System.out.println ( "Enter the percentage of winnings that will be donated to charity:" );
int donation = keyboard.nextInt();
System.out.println ( "TRUE/FALSE: Allocations to be rounded down to the nearest multiple of $100:" );
String rounded = keyboard.next();
System.out.println ( "TRUE/False: Purchaser of richest winning ticket receives a double share:" );
String richest = keyboard.next();
{
if( richest == "TRUE" )
System.out.println ( " Richest Winning Ticket share: " + winnings / 4 *2 );
}
System.out.println( "Here are the allocations for your winnings in the Super Jackpot Lottery...\n " );
System.out.println ( "Total Winnings: " + winnings );
System.out.println ( "Number of shares: " + Tickets );
{
if( rounded == "True" )
System.out.println ( "Winnings per share: " + (winnings / 4) *100 / 100 );
System.out.println ( " Unallocated Winnings: $ " + ( winnings - donation - ( winnings / Tickets * Tickets ) * 100 / 100 ) );
System.out.println ( " Percent ROI after donation: " + 100 * ( winnings - price ) / price * 100 / 100 );
if( rounded == "False" )
System.out.println ( "Winnings per Share: " + winnings / 4 );
System.out.println ( " Percent ROI after donation: " + 100 * ( winnings - price ) / price );
System.out.println ( " Unallocated Winnings: $ " + ( winnings - donation - ( winnings / Tickets * Tickets ) ));
}
}
// end main
}
// end class