The manager of Pizza Palace wants a program that calculates and displays the number of slices of pizza into which a circular pizza can be divided. The manager will enter the radius of the entire pizza. For this problem, use 14.13 as the area of a pizza slice, and use 3.14 as the value of pi. Write a Java program to help the manager of Pizza Palace
1
Expert's answer
2015-07-22T01:25:13-0400
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in); double radius = in.nextDouble(); double sliceNumber = 3.14 * radius * radius / 14.13; int answer = (int) sliceNumber; if (sliceNumber > answer) { System.out.println(++answer); } else { System.out.println(answer); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment