Design a dynamic programming algorithm to find which packages the thief will take away to get the highest value.
Q: Testing for SQL-injection vulnerability: Suggest an approach for testing an application to find if i...
A: An approach to test an application: The test approach here is to enter a string having a single quo...
Q: Briefly explain default argument initializer
A: NOTE: - The explanation is as per the C++ language. ANS: - The programmer does not need to specify ...
Q: Question 1: True or False: [ ] Telephone network is an example of Packet Switching network. [ ...
A: The given statement is false because : Telephone network is example of circuit switching network no...
Q: by using c++ solve following questions 1. Write a program that inputs ten numbers from the user in a...
A: 1. Array: An array is a homogeneous kind of elements or numbers stored in contagious memory locatio...
Q: What would be the result of the following operation: shra r1, r2, 13 ; given R[2] = 1001 0111 1110 1...
A: Given: shra r1, r2, 13; R[2]= 1001 0111 1110 1010 1110 1100 0001 0110
Q: Which INT 21h function would you use to check the standard input buffer to see if a character is wai...
A: Function INT 21h used to check the standard input buffer to see if a character is waiting to be proc...
Q: To build a highly available distributed system, you must know what kinds of failures can occur. a. L...
A: Distributed computing systems: A distributed computing system consists of a large number of softwar...
Q: Explain the phantom phenomenon. Why may this phenomenon lead to an incorrect concurrent execution de...
A: ANS: - Phantom Phenomenon: - This phenomenon arises, when there is conflict in two transactions due ...
Q: Question 2: What best describe the following : A collection of computer networks interconnected toge...
A: A PC network is a lot of associated PCs together. PCs on a system are called hubs. The collection be...
Q: When you want to know the position of the substring, you can use one of the __________ of a string o...
A: IndexOf or LastIndexOf methods: TrimStart or TrimEnd methods are used to remove occurrences of any ...
Q: Write a C++ program to find the number of digits in an integer entered by the user. Note: - Use whil...
A: Below is the required C++ program: - Approach: - Import the header file and use the namespace std f...
Q: What is the Virtual Key Symbol of Left Shift?
A: ANS: - The Virtual key symbol for Left Shift: - VK_LSHIFT
Q: Can you please show me what I'm doing wrong. My contributions are on lines 10-14.
A: The program intializes the below variable, shipcost = 0; final int FLAT_FEE_CENTS = 75; final int C...
Q: Python:Write a function quadratic_roots(a,b,c) which solves the quadratic equation ??2+??+?=0 for an...
A: Programming instructions: Import necessary library. Declare the required variables. Call the functi...
Q: Write the code in Python: 1.Write code that produces the following line of output: Jenny yelled "Run...
A: Note: According to the BNED guidelines we can only answer one question at a time. Please re-post a q...
Q: Create a class that holds the following personal data in properties: name, address, age, and phone n...
A: Program code: //Defining the class to hold the personal data class Person { //Declaring the vari...
Q: Calculator.java, is a simple command-line calculator. Note the program terminates if any operand is ...
A: Programming Approach: Importing all the necessary header files. Declaring the main class Calculator...
Q: What two questions should you ask to determine a class’s responsibilities?
A: Class’s responsibilities: After the identification of potential classes, the next step is to identi...
Q: Go to the Outline Styles section. In this section, you’ll format the course outline that appears on ...
A: Explanation: Open the cw_styles.css file in any available text editor and write the style rule to s...
Q: by using c++
A: Program: #include<iostream> using namespace std; int main() { int noOfRows, i, j, k, noOfCol; ...
Q: Write a program that prompts for an odd integer that is between 50 and 100, inclusive. Use just one ...
A: Note: Since it is not mentioned that which programming language to be used So, i prefered to write t...
Q: Stacks are useful in situations where: (There maybe more then one answer) A. a higher priority el...
A: Stacks are useful when the items are to be processed in LIOF, that is, Last In First Out order. Ther...
Q: Choose the correct value of num:after the function calls return. num = -2 num = 1 num = 0 num = 3 nu...
A: Introduction of Program This Program calling functionB inside the functionA. Here num is assigned a ...
Q: 1. Convert the following binary number to hexadecimal: 11011011 _______________ 2. Convert ...
A: Binary number to Hexa number: Group the binary number into 4 bits each and set the equivalent hexade...
Q: Consider the relational database of Figure 3.19, where the primary keys areunderlined. Give an expre...
A: The Structured Language Query (SQL) to find the ID, name, and city of residence of each employee who...
Q: Write the abstract and concrete RTN for the "shr" instruction.
A: The abstract RTN for the “shr” instruction: shr (:=op=26) → R[ra] <31..0> ← (n@0) #R[rb] <3...
Q: Explain the following Expressions Flow Control Encapsulation PDU Segmentation and reassembly Define...
A: A question with multiple parts is asked so only the first three parts will be answered. Please uploa...
Q: Let A, B, and C be the following statements:A Roses are red.B Violets are blue.C Sugar is sweet.Tran...
A: Translating the given compound statements into symbolic notation: Given: A: Roses are red B: Violets...
Q: Write a program that prompts the user to enter thecenter coordinates, width, and height of two recta...
A: Program Plan: Import required packages. Declare the main class named “Test” which extends the “Appl...
Q: Leah Jones is the IT manager at Rock Solid Outfitters, a medium-sized supplier of outdoor climbing a...
A: The table below includes three potential aspects (Signed up for Newsletter, Completed Survey Form an...
Q: My homework is I have to write a java program that calculates how fast a bucket will fill up. I will...
A: Here, in this program, you need to calculates how fast a bucket will fill up. Program inputs which ...
Q: answer please.
A: Pivot table A pivot table is one of the powerful features of Excel. It takes a large and detailed d...
Q: Which of the options is the purpose of the following function: (define (double input-number) (* 2 in...
A: Function description The function named double accepts one argument "input-number" of type Number an...
Q: question in pic
A: Assume that the frames are initially empty. The red boxes depict a miss and the green boxes depict a...
Q: Write a program that first gets a list of 5 integers from input. Then, get another value from the in...
A: Coral is a super basic language for picking up programming. It has constructs required for fundament...
Q: Write a program to print the following numbers: 1 1 2 1 2 3 1 2 ...
A: Program code: //define main class public class Main { //define main method public static void main(...
Q: 2. Write a C program to count the number of alphabets (upper-case and lower-case) and numbers in a s...
A: Below is the required code in C language. Program Approach: Including header files. Defining a main...
Q: What is scrubbing, in the context of RAID systems, and why is scrubbing important?
A: Data scrubbing: The data scrubbing is a method of error correction. It inspects the main memory or...
Q: A helper function is. . . A) a function that calls itself. B) a function that neither calls another ...
A: A helper function is one that is called by another function. Therefore, the correct option is C.
Q: click on image to make it more clear. also this is on visual basics (vb)
A: A list box is been added to the form with Name as lstNames. A label has been added to the form and N...
Q: Write a PYTHON function to display the sum of all the digits of a number. Ex. 234= 2+3+4=11
A: A Python program containing a function to display the sum of all the digits of a number is as follow...
Q: Explain the syntax of return statement.
A: Return statement: The statement which makes the function to end immediately is the return statement...
Q: What does the phrase “calling a method” mean?
A: Answer: A method call is a transfer of control of the program. When the user calls a method, what r...
Q: by using c++ solve following questions. 1. Write a program that inputs age in years and displays ...
A: Solution: 1. Program Approach: Include header files and namespace std. Define main method in the m...
Q: I am not sure where to start. Please explain.
A: Code comments have been added in the code for better explanation of the code for your reference.
Q: I'm unsure what to do
A: Program approach: Use the formula (G*M) / (d2) to compute the acceleration of gravity. Here G and M...
Q: Write the first line of the definition for a Poodle class. The class should be derived from the Dog ...
A: NOTE: - The solution is in Python language. ANS: - Here Dog is the base class while Poddle is the ch...
Q: Briefly describe the REPEAT directive.
A: REPEAT Directive: The ng-repeat directive is normally used to repeat a collection of HTML, a specif...
In the supermarket there are 5 packages with the profit of 4, 2, 1, 2, 10 and their weights are 12, 2, 1, 1, and 4. A thief breaks into the supermarket, the thief cannot carry weight exceeding 17kg. Design a dynamic
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Computer Science Investing in stocks is a way to create assets that are supposed to provide financial security over time. In solving this problem, we assume that an investor buys several shares of stock at a certain price. These shares are going to be sold later on for a different price. Obviously, if the selling price is higher than the acquisition price, the investor makes a profit, registering capital gain. If the shares are sold at a lower price, the investor has a loss, which marks a negative capital gain. This whole process is done over a period of time, and you are required to create a scenario for buying and selling shares. The assumption is that the investor sells shares in the order in which they were purchased. The goal is to calculate the capital gain over time. Suppose that you buy n shares of stock or mutual fund for d dollars each. Later, you sell some of these shares. If the sale price exceeds the purchase price, you have made a profit—a capital gain. On the other…Shamira Laundry has designed a new calculation system for their shop. The price for each type is as follows: 10 Туре Price Clothes RM 15 for 1 kilogram blankets / towels RM 6 for 1 kilogram RM 10 for 1 kilogram comforter Only one type can be washed at a time. This laundry shop also provides discounts to its customers as follow: Total price >= RM30 Discount 10% from total price >= RM20 dan = RM15 danGiven n distinguished dice each with m faces, numbered from 1 to m, Design a dynamic programming algorithm to find the number of ways to get sum X, where X is the sum of values on each face when all the dice are thrown.ASAPThree prisoners have been sentenced to long terms in prison, but due to over crowed conditions, one prisoner must be released. The warden devises a scheme to determine which prisoner is to be released. He tells the prisoners that he will blindfold them and then paint a red dot or blue dot on each forehead. After he paints the dots, he will remove the blindfolds, and a prisoner should raise his hand if he sees at least one red dot on the other two prisoners. The first prisoner to identify the color of the dot on his own forehead will be release. Of course, the prisoners agree to this. (What do they have to lose?) The warden blindfolds the prisoners, as promised, and then paints a red dot on the foreheads of all three prisoners. He removes the blindfolds and, since each prisoner sees a red dot (in fact two red dots), each prisoner raises his hand. Some time passes when one of the prisoners exclaims, "I know what color my dot is! It's red!" This prisoner is then released. Your problem…Loyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be usedimmediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows:For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent.For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples:For purchases of R 460.00, 9 loyalty points will be awarded.For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for theremaining R 160.00 = 16 loyalty pointsFor purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for theremaining R 750.00 = 40 loyalty pointsThe monetary value of the loyalty points is calculated as follows:The first 30 loyalty…Loyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be usedimmediately with the current transaction or can be accumulated.The number of loyalty points per transaction is calculated as follows:For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent.For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent.Examples:For purchases of R 460.00, 9 loyalty points will be awarded.For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for theremaining R 160.00 = 16 loyalty pointsFor purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for theremaining R 750.00 = 40 loyalty pointsThe monetary value of the loyalty points is calculated as follows:The first 30 loyalty…Consider the following scenario: A high school has 1000 students and 1000 lockers, one locker for each student. On the first day of school, the principal plays the following game: She asks the first student to open all the lockers. She then asks the second student to close all the even-numbered lockers. The third student is asked to check every third locker. If it is open, the student closes it; if it is closed, the student opens it. The fourth student is asked to check every fourth locker. If it is open, the student closes it; if it is closed, the student opens it. The remaining students continue this game. In general, the nth student checks every nth locker. If it is open, the student closes it; if it is closed, the student opens it. After all the students have taken turns, some of the lockers are open and some are closed. The program below, when ran, will prompt the user to enter the number of lockers in the school. After the game is over, the program will output the number of…Loyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used immediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows: For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent. For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples: For purchases of R 460.00, 9 loyalty points will be awarded. For purchases of R 660.00, 10 loyalty points will be awarded for the first R 500.00 and 6 loyalty points for the remaining R 160.00 = 16 loyalty points For purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for the remaining R 750.00 = 40 loyalty points The monetary value of the loyalty points is calculated as follows: The first…Devon designs a computer algorithm that gives users a movie recommendation based on information entered into a viewer profile. Users are asked to rate the recommendation as either "good" or "bad." After testing the algorithm, Devon concludes that the algorithm offers good movie recommendations in 87% of all cases, with a 3% margin of error. Devon expects the algorithm to offer approximately 5,000 movie recommendations this month, and he wants to calculate the number of recommendations that are expected to be "good." What would the likely range of "good" recommendations be? A. 1,400 to 4,550 good recommendations B. 4,100 to 4,550 good recommendations C.4,200 to 4,500 good recommendations D. 4,285 to 4,459 good recommendationsLoyalty points are awarded by a company based on the amount a customer spend. Loyalty points can be used immediately with the current transaction or can be accumulated. The number of loyalty points per transaction is calculated as follows:For purchases of R 500.00 or less, 1 loyalty point will be awarded per R 50.00 spent. For purchases of more than R 500.00 the following applies: For the first R 500.00, 1 loyalty point will be awarded per R 50.00 spent For the remainder of the amount, 2 loyalty points will be awarded per R50.00 spent. Examples:For purchases of R 460.00, 9 loyalty points will be awarded.For purchases of R 660.00, 10 loyalty points will be awarded for the first R500.00 and 6 loyalty points for theremaining R160.00 = 16 loyalty pointsFor purchases of R 1250.00, 10 loyalty points will be awarded for the first R 500.00 and 30 loyalty points for theremaining R 750.00 = 40 loyalty points The monetary value of the loyalty points is calculated as follows: The first 30…Suppose, you are working in a company ‘X’ where your job is to calculate the profit based on their investment. If the company invests 100,000 USD or less, their profit will be based on 75,000 USD as first 25,000 USD goes to set up the business in the first place. For the first 100,000 USD, the profit margin is low: 4.5%. Therefore, for every 100 dollar they spend, they get a profit of 4.5 dollar. For an investment greater than 100,000 USD, for the first 100,000 USD (actually on 75,000 USD as 25,000 is the setup cost), the profit margin is 4.5% where for the rest, it goes up to 8%. For example, if they invest 250,000 USD, they will get an 8% profit for the 150,000 USD. In addition, from the rest 100,000 USD, 25,000 is the setup cost and there will be a 4.5% profit on the rest 75,000. Investment will always be greater or equal to 25,000 and multiple of 100. Complete the RECURSIVE methods below that take an array of integers (investments) and an iterator (always sets to…SEE MORE QUESTIONS