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
Evgesh-ka [11]
3 years ago
8

Doug's Cafe uses 2/3 of a bag of coffee every day. For how many days will 1 1/3 bags of coffee last?​

Mathematics
2 answers:
shusha [124]3 years ago
5 0
The bags of coffee will last up to 5.5 days( five 1/2 days )
slega [8]3 years ago
3 0

Answer:

I believe it would last 5 and a half days

Step-by-step explanation:

You might be interested in
The fundamental source of the inefficiency is not the fact that recursive calls are being made, but that values are being recomp
Fudgin [204]

Step-by-step explanation:

<em>(you can download the attached PDF for a better view)</em>

The Fibonacci sequence is a well-known mathematical sequence in which each term is the sum of the two previous terms.

More specifically, if fib(n) is the nth term of the sequence, then the sequence can be defined as follows:

fib(0) = 0

fib(1) = 1

fib(n) = fib(n-1) + fib(n-2) n>1

1. Because the Fibonacci sequence is defined recursively, it is natural to write a recursive method to determine the nth

number in the sequence. File Fib.java contains the skeleton for a class containing a method to compute Fibonacci

numbers. Save this file to your directory. Following the specification above, fill in the code for method fib1 so that it

recursively computes and returns the nth number in the sequence.

2. File TestFib.java contains a simple driver that asks the user for an integer and uses the fib1 method to compute that

element in the Fibonacci sequence. Save this file to your directory and use it to test your fib1 method. First try small

integers, then larger ones. You'll notice that the number doesn't have to get very big before the calculation takes a very

long time. The problem is that the fib1 method is making lots and lots of recursive calls. To see this, add a print

statement at the beginning of your fib1 method that indicates what call is being computed, e.g., "In fib1(3)" if the

parameter is 3. Now run TestFib again and enter 5—you should get a number of messages from your print statement.

Examine these messages and figure out the sequence of calls that generated them. (This is easiest if you first draw the

call tree on paper.) . Since fib(5) is fib(4) + fib(3),you should not be surprised to find calls to fib(4) and fib(3) in the

printout. But why are there two calls to fib(3)? Because both fib(4) and fib(5) need fib(3), so they both compute it—very

inefficient. Run the program again with a slightly larger number and again note the repetition in the calls.

3. The fundamental source of the inefficiency is not the fact that recursive calls are being made, but that values are being

recomputed. One way around this is to compute the values from the beginning of the sequence instead of from the end,

saving them in an array as you go. Although this could be done recursively, it is more natural to do it iteratively. Proceed

as follows:

a. Add a method fib2 to your Fib class. Like fib1, fib2 should be static and should take an integer and return an integer.

b. Inside fib2, create an array of integers the size of the value passed in.

c. Initialize the first two elements of the array to 0 and 1, corresponding to the first two elements of the Fibonacci

sequence. Then loop through the integers up to the value passed in, computing each element of the array as the sum

of the two previous elements. When the array is full, its last element is the element requested. Return this value.

d. Modify your TestFib class so that it calls fib2 (first) and prints the result, then calls fib1 and prints that result. You

should get the same answers, but very different computation times.

// ******************************************************************

// Fib.java

//

// A utility class that provide methods to compute elements of the

// Fibonacci sequence.

// ******************************************************************

public class Fib

{

//--------------------------------------------------------------

// Recursively computes fib(n)

//--------------------------------------------------------------

public static int fib1(int n)

{

//Fill in code -- this should look very much like the

//mathematical specification

}

// ******************************************************************

// TestFib.java

//

// A simple driver that uses the Fib class to compute the

// nth element of the Fibonacci sequence.

// ******************************************************************

import java.util.Scanner;

public class TestFib

{

public static void main(String[] args)

{

int n, fib;

Scanner scan = new Scanner(System.in);

System.out.print("Enter an integer: ");

n = scan.nextInt();

fib = Fib.fib1(n);

System.out.println("Fib(" + n + ") is " + fib);

}

}

Download pdf
8 0
3 years ago
Read 2 more answers
Find m k(8x-29)<br> L(3x-1)<br> J(6x-11)
kicyunya [14]

Answer:

k(8×-1)=8k-28

=-20k

L(6×-11)=6L-10

=-4L

J(3×-1)=3L

7 0
3 years ago
Need help ASAP
a_sh-v [17]
<h2>Answer:</h2><h2>(i) Total expenses = $ 300</h2><h2>(ii) Net income(savings) = $ 0</h2>

Step-by-step explanation:

Total income earned by Sam = $ 300

(i) Expense calculation,

Clothes expense = 30 % = 30 % (300) = $ 90

Food and snacks expense = 23 % = 23 % (300) = $ 69

Cell phone expense = 14% = 14% (300) = $ 42

Transportation expense = 10% = 10% (300) = $ 30

Gym expense = 10% = $ 30

Movies expense = 8% = 8% (300) = $ 24

Apps expense = 5% = 5% (300) = $ 15

Total expenses = (90 + 69 + 42 + 30 + 30 + 24 + 15) = $ 300

(ii) Sam's net income is the profir earned  after his expense.

Net income = 300 - 300 = $ 0

4 0
3 years ago
Question 7 of 10
bonufazy [111]

Answer:

A & D

Step-by-step explanation:

A. acute because all angles are less than 90 degrees

D. scale because all sides have different

if you look up the definition of the properties you will see they don't apply

4 0
3 years ago
Read 2 more answers
Please help please!!
Nezavi [6.7K]

Answer:

-6 I think

Step-by-step explanation:

3 0
3 years ago
Other questions:
  • If after two hours 4 Inches off snow has fallen how many inches would have fallen after 6.6 hours
    10·1 answer
  • Plz help 98 pts<br> show all work
    6·2 answers
  • the floor of a house is shaped like a parallelogram the height of the parallelogram is 8 feet less than the base. the base is 48
    11·1 answer
  • Find the specific solution of the differential equation dy/dx equals the quotient of 2 times y and x squared with condition y(-2
    9·1 answer
  • Find the number please
    13·2 answers
  • 12. Solomon scored 88% on his math test. If the test had 25 questions total, how many
    6·1 answer
  • Can you please help me​
    10·1 answer
  • Please can someone help?
    12·1 answer
  • f(x) = 3/4 * x - 7 . Find x if f(x) = - 1 . PLEASE tell how to solve it bc that what i dont know, i dont want just the answer​
    9·1 answer
  • A cup of coffee contains 140 mg of caffeine. If caffeine leaves the body at 10% an hour, how long will it take for half of the c
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!