Roundind up numbers using Math.ceil
I'm writing a simple program for my Java fundamentals class and I was instructed to round up the results using the Math.ceil () method but I have not been able to successfully incorporate it into my code. Tips?
// Program helps student determine how many pizza and soda should
// be purchased for student activities.
import java.util.Scanner;
public class PizzaSoda
{
public static void main(String[] args)
{
int People;
double Hours;
double Pizza = .4;
double Soda = .25;
double Result, Value;
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter the number of people expected to attend this activity: ");
People = keyboard.nextInt();
System.out.print("Enter the duration of the activity in hours: ");
Hours = keyboard.nextDouble();
System.out.println((Pizza * People) + " whole pizzas will be needed.");
System.out.println((Soda * People * Hours) / 2 + " 2-liter bottles of soda will be needed.");
System.exit(0);
}
}