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
iren [92.7K]
3 years ago
10

A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a se

rving equals 300 calories. Write a Java program that lets the user enter the number of cookies he or she actually ate and that then reports the number of total calories consumed.
Computers and Technology
1 answer:
laila [671]3 years ago
4 0

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

   Scanner in = new Scanner (System.in);

       System.out.println("How many cookies did you eat today");

       int numOfCookies = in.nextInt();

       double numCalories = (numOfCookies*300)/4;

       System.out.println("The total number of calories you consumed in "+numOfCookies+" cookies is " +

               " "+numCalories);

   }

}

Explanation:

This code is implemented in Java.

  1. We know from the question that 4 cookies contain 300 calories
  2. Therefore number of calories consumed = (number of cookies eaten*300)/4
  3. To implement this in java we used the scanner class to prompt user for the input
  4. save the input to a variable and write mathematical expression for the number of calories consumed
  5. Then output the result

You might be interested in
For each of the users of accounting information, identify whether the user is an external decision maker (E) or an internal deci
jarptica [38.1K]

Answer:

Customer (E), Company manager (I), Internal Revenue Service (E), Lender (E), Investor (E), Controller (I), Cost accountant (I), SEC (E).

Explanation:

First of all, we need to define what exactly is an External Decision Maker (E) and an Internal Decision Maker (I).

External Decision Makers, these are people <u><em>outside the company</em></u><em> </em>that make decisions, for example: Customer, Internal Revenue Service, Lender, Investor and The U.S. Securities and Exchange Commission (SEC).

<u>Customers</u> are external because they don't belong to the company.

<u>Internal Revenue Service </u>is an institution of the  Government of the U.S., that's why is outside the company.

<u>Lender</u>, this person or financial institution is not involved in the company in self, only lends money to the company, that's it.

<u>Investor,</u> as it was said above, it's the person or institution that only lends the money to the company, without being part of the insides.

<u>The U.S. Securities and Exchange Commission (SEC)</u> is an institution of the U.S. Government, so it's outside the company.

Internal Decision Makers, these are people inside the company, they are absolutely involved in the direct decisions, for example, Company Manager, Controller and Cost Accountant.

<u>Company Manager</u> is the head of the company, the person in this position absolutely makes company decisions to coordinate all departments.

<u>Controller</u>, this person has the responsibility of all accounting related activities, that's why is an internal decision maker.

<u>Cost Accountant,</u> is an internal decision maker because is the person in this position has to be a financial specialist who determines costs of the products or services that the company offers.

So, there you have it, it's a pleasure to help.

4 0
4 years ago
Briefly explain how an operating system may be described as an "interrupt-driven program." as system calls) from
Reptile [31]

Answer: Interrupt-driven program is defined as the program that permits to executes by stopping the execution of the currently running program.The completion of the program is indicated by the interrupt as a signal from assistant action .

Operating system is the system that carries out the functions and task of computer system.It has the major mechanism in which every alteration and changes are remarked such as state of hardware, event alteration, software component changes etc by the interrupt system.

Through interrupt system the operating system conducts new assignment and task for the compensation of changes that occurred in the system by halting the current working. Resources are invoked to fulfill the requirement of the work load.Thus, operating system can act in interrupt driven system's  manner.

7 0
3 years ago
A copyright gives the exclusive legal right to the original author or creator to print, publish, perform, record, or produce mat
KatRina [158]

Answer:                

True.                                

Explain: TRUE                                                  

4 0
3 years ago
Read 2 more answers
___________ is a technique of exhaustively working through all possible combinations of letters, numbers, and special characters
olga2289 [7]
Brute force




_______________
4 0
4 years ago
Open the Undergrad Debt data in the Excel file. Nationally, on average, a college student last year graduated with $27,200 in de
Rom4ik [11]

Answer:

Arkansas students have higher debt than the national average, $27,200.

Explanation:

The provided data is:

S = {24040, 19153, 26762, 31923, 31533, 34207, 14623, 24370, 31016}

In this case we need to test whether Arkansas students have higher debt than the national average at alpha equal to 0.10.

The hypothesis can be defined as follows:

<em>H</em>₀: Arkansas students does not have higher debt than the national average, i.e. <em>μ</em> ≤ $27,200.

<em>Hₐ</em>: Arkansas students have higher debt than the national average, i.e. <em>μ</em> > $27,200.

Compute the sample mean:

\bar x=\frac{1}{n}\sum X=\frac{1}{10}\times 213537=21353.70

As the population standard deviation is provided, we will use a z-test for single mean.

Compute the test statistic value as follows:

z=\frac{\bar x-\mu}{\sigma/\sqrt{n}}=\frac{21353.70-27200}{5000/\sqrt{10}}=-3.70

The test statistic value is -3.70.

Decision rule:

If the p-value of the test is less than the significance level then the null hypothesis will be rejected.

Compute the p-value for the test as follows:

 p-value=P(Z>-3.70)=P(Z

*Use a z-table for the probability.

The p-value of the test is 0.00011.

<em>p</em>-value = 0.00011 < <em>α</em> = 0.10

The null hypothesis will be rejected.

Thus, it can be concluded that Arkansas students have higher debt than the national average, $27,200.

5 0
3 years ago
Other questions:
  • Consider a set of mobile computing clients in a certain town who each
    13·1 answer
  • How can you clean out the scales in an electric iron without taking the iron apart? A. By rinsing the tank and holes with a wate
    12·2 answers
  • How much a 1 Gigabyte in Bytes:<br> 1. 1e+9<br> 2. 1e+6<br> 3. 1000
    8·2 answers
  • Your boss is very skeptical about the idea of storing his files up in the cloud rather
    8·1 answer
  • Whats the answer to this question?
    7·1 answer
  • You are required to copy in your attendees' emails from outside of Outlook when creating a meeting
    6·2 answers
  • Using the Caesar cipher, "HELLO" is encrypted to "OLSSV" by applying a shift of 7. The number 7 is considered the __________
    5·1 answer
  • Which lighting technique can often heighten a dramatic story?
    14·1 answer
  • To add a hyperlink to your presentation, select the text, choose Hyperlink from the Insert menu, and then
    15·1 answer
  • Assume the name of your data frame is flavors_df. What code chunk lets you review the structure of the data frame?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!