Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java please Required Skills Inventory - Declare a variable - import java.util. Scanner - Declare and instantiate a Scanner - Use System. out. print

in java please image text in transcribed
image text in transcribed
Required Skills Inventory - Declare a variable - import java.util. Scanner - Declare and instantiate a Scanner - Use System. out. print to prompt the user for input - Use a Scanner to collect user input - Use math operators to construct an expression - Use Math methods to construct an expression - Use Math. ceil to round a value up - Use an expliot type casting to construct an expression - Store a value in a variable - Use String literals to define a String value - Retrieve a value from a variable - Output the value of a variable to the console - Use String concatenation operator to construct an expression - Concatenate the value of a variable and a String - Output to console with System. out.print In Problem Description and Given Info Write a Java program that takes two int numbers as the inputs. The first number will be the total number of people at a party, and the second number will be the number of slices of pizza each person will get. The program should compute and output the number of pizzas we will need in order to feed everyone. Assume that each pizza will have 8 slices. Be sure to round up to the nearest whole number of pizzas to order. The Math. ceil function will be useful for this purpose Here is an example of what the user should see when the program runs. Enter total number of people : 10 Enter the numer of slices each person will get : 5 Number of pizzas to order t 7 For the given inputs, make sure that your program outpus looks exactly like the example above (including spelling, capitalization, punctuation, spaces, and decimal points). Hints - You may need to cast or convert some values from one data type to another. Remember that when you divide an int by an int or multiply an int by and int, the result will always be an int. Need Help? Additional help resources are avallable by clicking on the words "Need Helpr at the bottom of this page. and search for help or ask a question! 6.9.1: Pizta Order (individual Assignment) I/ Below this comment: declare any other variables you may need II Below this comment: collect the required user inputs U Below this comment: compute the number of pizzas to order and store the value in a variable Below this comment: write a Java code to display the number of pizzas to order Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions