


JAVA PROGRAM
import java.util.*;
public class time {
public static void main(String []args) {
Scanner s = new
Scanner(System.in);
System.out.print("Enter the value
of n: ");
int n = s.nextInt();
int time = 500;
for(int i=1; i<=n; i++) {
time = time +
8;
for(int j=7;
j<=i+1; j++)
time = time + 24*j;
}
System.out.println();
System.out.println("The value of
time is: "+time);
}
}


For Q2), Q3) and Q4) use the following formulas as necessany ?=n(n+1) ?: = n(n +...
Problem 1: Let W(n) be the number of times "whatsup" is printed by Algorithm WHATSUP (see below) on input n. Determine the asymptotic value of W(n). Algorithm WHATSUP (n: integer) fori1 to 2n do for j 1 to (i+1)2 do print("whatsup") Your solution must consist of the following steps: (a) First express W(n) using summation notation Σ (b) Next, give a closed-form formula for W(n). (A "closed-form formula" should be a simple arithmetio expression without any summation symbols.) (c) Finally,...
Year Quarter Units 1 Q1 20 1 Q2 100 1 Q3 175 1 Q4 13 2 Q1 37 2 Q2 136 2 Q3 245 2 Q4 26 3 Q1 75 3 Q2 155 3 Q3 326 3 Q4 48 4 Q1 92 4 Q2 202 4 Q3 384 4 Q4 82 5 Q1 176 5 Q2 282 5 Q3 445 5 Q4 181 Using this data: a. Plot this data on a line chart with quarters from years 1-5 on...
Grohl Products has projected the following sales for the coming year: Q1 Q2 Q3 Q4 Sales $720 $790 $960 $880 Sales in the year following this one are projected to be 15 percent greater in each quarter. Requirement 1: Calculate payments to suppliers assuming that the company places orders during each quarter equal to 30 percent of projected sales for the next quarter. Assume that the company pays immediately. (a) What is the payables period in this case? (Do not...
1. (13 points) Use the limit of a Riemann Sum (i.e. sigma notation and the appropriate summation formulas) to evaluate the net-signed area between the graph of f(0) = 23 – 3 and the interval (0, 2). Let 27 be the right endpoint of the k-th subinterval (where all subintervals have equal width). Give your answer as a single integer or frac- tion, whichever is appropriate. Using any technique other than a limit of a Riemann Sum will earn no...
Problem 1: Give the exact and asymptotic formula for the number f(n) of letters “A” printed by Algo- rithm PRINTAs below. Your solution must consist of the following steps: (a) First express f(n) using a summation notation 2 (b) Next, give a closed-form formula for f(n). (c) Finally, give the asymptotic value of the number of A's (using the O-notation.) Include justification for each step. Note: If you need any summation formulas for this problem, you are allowed to look...
Q2-Σ Notation Review notation by investigating In this problem we will remind ourselves of 2k k O a) Consider the similar finite sum 2* k-0 Using n - 3, rewrite this expression in expanded form, and then evaluate it. b) Rewrite Expression (2) in expanded form for n-6, and then evaluate it c) Expression (2) becomes a better approximation to Expression (1) as n grows larger. To get an idea of what (1) is, evaluate (2) using n 100. Don't...
Question 1 Given the following diagram, answer questions 1.1 to 1.3: Price Q3 QEQo Q2 04 Quantity 1.1 P2 represents a price imposed by the government. What is the quantity of this good that would be exchanged in the market? A) Q. B) O C) D) Q3 E) Q. 1.2 To be effective, a price floor must lie A) above P, but below P. B) below P, but above P, C) anywhere above P, D) anywhere below P. E) within...
Use iteration to guess an explicit formula for the
sequence...
Materials for Reference:
Homework Problems Solve the following problems 1. Use iteration to guess an explicit formula for the sequence. Use the formulas from summation formula.pdf to simplify your answers whenever possible. (Follow the solution of exercise set 57-problem #5, on page A-43) dk-4dk-1+3, for all integers k2 2,where d1-2 2. Use iteration to guess an explicit formula for the sequence. Use the formulas from summation formula.pdf to simplify your...
Just Q3 and Q4
Q1] Write a C function to implement the binary search algorithm over an array of integer numbers and size n. The function should return the index of the search key if the search key exists and return - 1 if the search key doesn't exist. [10 Points] Q2] Write a C function to implement the selection sort algorithm, to sort an array of float values and size n. The function should sort the array in ascending...
8. Following are percentage change of real GDP from the preceding quarter. Q1-2020: \(-1.26 \%\) Q2-2020: \(-8.98 \%\), Q3-2020: \(7.48 \%\), and Q4-2020: \(0.99 \%\) (Hint: Q1-2020 figure means that the real GDP in the US grew at a rate of \(-1.26 \%\) over quarter 1 of 2020 compared to the level of real GDP in quarter 4 of \(2019 .\) ) Given this information, which of the following statements is false?a) US GDP in 2020 was higher than its...