1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alborosie
3 years ago
12

To plan a pizza party, one may want to order enough pizza for everyone. Use the slicesInPizza, slicesPerPerson, and totalGuests

variables to compute the total number of pizzas needed to feed all the guests and store the result in totalPizzas. The total may have a decimal place.
1 var slicesInPizza = 8; // Code tested with values: 8 and 12
2 var slices PerPerson = 4; // Code tested with values: 4 and 5
3 var totalI Persons = 12; // Code tested with values: 12 and 10
4
5 var pizzasNeeded = 0;
Computers and Technology
1 answer:
zheka24 [161]3 years ago
6 0

Answer:

Explanation:

The following code was written in Javascript. It asks the user to enter the values for each of the variables and saves it to them. Then it uses those values to calculate the total number of pizzas needed to feed everyone at the party. Finally, it prints out the total to the screen as an alert. Both test cases were used and the outputs can be seen in the attached images below.

var slicesPerPizza = window.prompt("How many slices per pizza?");

var slicesPerPerson = window.prompt("How many slices per person?");

var totalPersons = window.prompt("How many total people will attend?");

var pizzasNeeded = Math.round((slicesPerPerson * totalPersons) / slicesPerPizza)

alert(`You need a total of ${pizzasNeeded} pizzas.`)

You might be interested in
When the computer makes room for sentences on the next line, this is called
OLga [1]
That's easy its called enter you can push enter and it will bring you to the next line so that's it good bye have a nice day
3 0
3 years ago
An Identity Theft Report is a combination of a police report and a report submitted to which of the following organizations
DENIUS [597]
Nut Busting Orgainazation
7 0
4 years ago
Why is it that when I try to change my password and email on here that is says that my password is incorrect, but really it's no
Fynjy0 [20]

Answer:

Because you might have some characters that look very similar but at not so that's why it says that your password is wrong.

Explanation:

6 0
3 years ago
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the f
Oksi-84 [34.3K]

Answer:

In Python:

fname = input("Filename: ")

a_file = open(fname)

lines = a_file.readlines()

print("Name\t\tHours\t\tTotal Pay")

for line in lines:

eachline = line.rstrip(" ")

for cont in eachline:

 print(cont,end="\t")

print()

Explanation:

This prompts the user for file name

fname = input("Filename: ")

This opens the file

a_file = open(fname)

This reads the lines of the file

lines = a_file.readlines()

This prints the header of the report

print("Name\t\tHours\t\tTotal Pay")

This iterates through the content of each line

for line in lines:

This splits each line into tokens

eachline = line.rstrip(" ")

This iterates through the token and print the content of the file

<em> for cont in eachline: </em>

<em>  print(cont,end="\t") </em>

<em> print()</em>

5 0
3 years ago
Write an if statement that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000.
aev [14]

Answer:

if(goodsSold>500000){

bonus = 10000;

}

Explanation:

A complete Java program that prompts user to enter value for goodsSold is given below:

<em>import java.util.Scanner;</em>

<em>public class num14 {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Enter goods Sold: ");</em>

<em>        int goodsSold = in.nextInt();</em>

<em>        int bonus =0;</em>

<em>        if(goodsSold>500000){</em>

<em>            bonus=10000;</em>

<em>        }</em>

<em>        System.out.println("You bonus for "+goodsSold+" is "+bonus);</em>

<em>    }</em>

<em>}</em>

3 0
4 years ago
Other questions:
  • The rule of thumb in the wireless industry is that a smartphone uses 4 gigabytes of data per month where ____ percent travels th
    14·2 answers
  • If a company doesn't distribute a computing use policy stating an employer's right to inspect employees' computers freely, inclu
    6·1 answer
  • If the test statistic for a small sample difference of means test is t* = 2.045, we could reject the Null Hypothesis at alpha =
    9·1 answer
  • Hurry asap it’s times
    8·1 answer
  • If a database is not maintained or if incorrect data is entered into the database, serious problems can occur. What problems cou
    15·1 answer
  • All of the following are aspects of the search process except?
    5·2 answers
  • When computing effect size, the sample size is ________.
    13·1 answer
  • Which of the following are examples of IT
    14·1 answer
  • 10
    14·2 answers
  • When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!