A store provides 10 percent discount on all items with a price of at least $100. No discount is otherwise applicable. Which of the following DOES NOT correctly compute the discount? explain your choice. a) double discount = 0; if (price >= 100) { discount = 0.10 * price; } b) double discount = 0.10 * price; if (price <= 100) { discount = 0; } %3!
Q: 've ran a result for each payment type, and I want to calculate the probability according to each…
A: Option 1: SELECT PaymentMethod, COUNT(*) AS NumberOfTransactions FROM Transaction GROUP BY…
Q: following solidity code segment aim to select a winner at random from the a set of players (assume…
A: It is defined as a contract-oriented, high-level programming language for implementing smart…
Q: Rock Paper Scissors Lizard Spock (RPSLS) is an extended version of the classical game of chance Rock…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: In the Dice Roll game, the player begins with a score of 1000. The player is prompted for the number…
A: I have provided JAVA CODE along with OUTPUT SCREENSHOT----------
Q: Suppose a punch recipe calls for a given amount of orange soda, measured in ounces. int amount = 32;…
A: The program computes the number of cans needed to store soda in it. Each can has 12 ounces capacity.…
Q: Suppose you have the Degree, and then find the Result As fallow: * B 1 Temperatures 2 Status -15 ? 3…
A: As the language is not mentioned in the question, i will solve the question with the help of python…
Q: Suppose, you have $10 to buy food for a day. You have several options, but you need to maximize…
A:
Q: Given the following: Group A (Tom 40, Dave 67) Group B (Jade 30, Molly 25) Group C (Max 50, Comfort…
A: Algorithm : Step 1 : declare variables. Step 2 : assign the marks of each student in each variable.…
Q: In a candy store, there are N different types of candies available and the prices of all the N…
A: In this question, we are asked to write a program in C++ where we have to print minimum amount of…
Q: Modify the following program so that it will read in and average four exam scores rather than two:…
A: Step 1:- The given instructions of the program are explained in two programming languages. I am…
Q: Let p be the statement "I fix my car," q be the statement "I will be able to sleep," and r be the…
A: Given statement, , and whether the statement "Either I fix my car or I will not be able to sleep,…
Q: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend…
A: Since programming language choice is not specified, we will be solving this question in c++…
Q: Let t0 be a specific value of t. Find t0 such that the statement is true: P(t ≥ t0) = 0.005 where df…
A: Dear Student, To find it's answer we need to refer to t-table . Here given that, P(t ≥ t0) = alpha =…
Q: Selling snake oil is a lucrative business. In a radical move, Company S now sells snake oil at 18…
A: Use an if conditional statement to check the volume and update respective discounts and shipping…
Q: In a candy store, there are N different types of candies available and the prices of all the N…
A: Code is given below as :
Q: Given the following grading criteria in the form of a logical expression, which set of values will…
A: The condition having two logical operators - "||" / "OR" Logical Operator - If any of the given…
Q: Calculate income tax for the given income by following the below rules: Total Income Rate (in %)…
A: In the above code, it has been asked to print the income tax on the given income, in the following…
Q: Q.5/ Use the case construct to do the following where n has been declared as an integer and x as a…
A: We will use case construct in Java language to solve the given problem.
Q: Write a program that will accept the following inputs from the user: Company ID,…
A: //Note:since programming language is not given, we are providing answer in…
Q: Do in C++ programming A game to collecting coins. In level # 1, whenever the player takes a coin,…
A: Answer: C++ Source Code: #include <iostream>#include<vector> using namespace std; int…
Q: Every patient has a primary physician. Every doctor has at least one patient. Each pharmacy sells…
A: The different type of entity sets are: • Company: this table holds information related to the…
Q: Q2: Replacement is a very generous institute that provides a Bonus monthly salary to their employees…
A: ANSWER:-
Q: The electricity accounts of residents in a very small town are calculated as follows: a) If 500…
A: ip = [200, 500, 700, 1000, 1500]; for i=1:5 un = ip(i); ct = 0; if un <= 500 ct = un * 0.02;…
Q: Given the following: Group A (Tom 40, Dave 67) Group B (Jade 30, Molly 25) Group C (Max 50, Comfort…
A: Given the following: Group A (Tom 40, Dave 67) Group B (Jade 30, Molly 25) Group C (Max 50, Comfort…
Q: Suppose that billingAmount is a double variable, which denotes the amount you need to pay to the…
A: Algorithm: Declare and initialize the constant variable creditOnFullBillingPayment with 10.00.…
Q: The electricity accounts of residents in a small town are calculated as follows. If 500 units or…
A: MATLAB Code: % Script that calculates the electricity bill % Input vectoripVec = [200, 500, 700,…
Q: Suppose you have the Degree, and then * :find the Result As fallow Status 1 Temperatures -15 3 15 4…
A: #include<iostream>using namespace std;int main(){ int temp[10],min=100; cout<<"Enter the…
Q: goal test, can be explicit or implicit , which of the following is implicit O x = "at Bucharest"…
A: goal test , can be explicit , e.g. x="at Bucharest " implicit , eg Checkmate(x) A Complete ,…
Q: Find the value of x from the following equation * x=cos(r^2 ) if r<O x=sin(r^2 ) if r20 r=-2:20 For…
A: Option 1 is the correct option.
Q: A password is considered strong if the below conditions are all met: • It has at least 6 characters…
A: AS programming language is not mentioned the following code is in python
Q: During the tax season, every Friday, the J&J accounting firm provides assistance to people who…
A: Please see the below step for solution.
Q: Rock Paper Scissors Lizard Spock (RPSLS) is an extended version of the classical game of chance Rock…
A: the code is an given below : You can place this code in your project. #include…
Q: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 B D Question 3-Categorize the…
A: The question has been answered in step2
Q: What is the probability that in a classroom of x people, at least 2 will be born on the same day of…
A: Introduction What is the probability that in a classroom of x people, at least 2 will be born on the…
Q: In the Dice Roll game, the player begins with a score of 1000. The player is prompted for the number…
A: Here the random library is used which is provided by python to generate the random numbers, here…
Q: Suppose you are an astrologer and you are predicting the zodiac sign of the customer using month and…
A: #include <stdio.h>#include <string.h> int main(){ // declare variables int…
Q: During the tax season, every Friday, the J & J tax accounting firm provides assistance to people who…
A: Given During the tax season, every Friday, the J & J tax accounting firm provides assistance…
Q: Write a program that takes five students' quizzes in a course. Consider each student has given ten…
A: Note: Since no programming language, therefore answering the given question in Python. Input :…
Q: A electricity bill service provider uses a program that computes the monthly bill of customers as…
A: Program Plan: Include standard header file and namespace Create a function calculateBill() if…
Q: Do in C++ programming A game to collecting coins. In level # 1, whenever the player takes a coin,…
A: { // your code here } #include <iostream> #include <vector> using namespace std;…
Q: If you have been given the full amount required and the list represents the amount of change in your…
A: Notes:- quarter: 25 cents / $0.25 dime: 10 cents / $0.10 nickel: 5 cents / $0.05 penny: 1 cent /…
Q: For tax purpose an item may be depreciated over a period of several years. With the straight-line…
A: Actually, program is a executable software that runs on a computer.
Q: After the following code is executed, which of I, II and/or III will evaluate to true? int [] a1 =…
A: SOLUTION: The condition that evaluates to true after the execution of the given code is: I only…
Q: An arcade machine accepts $0.50 and $0.75 tokens. Once the machine accepts at least $1.00, it stops…
A: DFA refers to deterministic finite automata. DFA machine reads an input string one symbol at a time.
Q: Suppose an ATM has two sections of 1000 and 500 rupees note. There are 20 notes of 500 and 10 notes…
A: total_1000notes=10 total_500notes=20x=Truewhile (x==True): amount=int(input()) if…
Q: C program of Mrs. Silva spent 4/5 of her money and found she had P12 left. Find how much she had at…
A: Consider, the amount of money Mrs. Silva had left with be n Let total be the amount of money Mrs.…
Q: Problem: Qty: X Machine A Total? Current Sol A Sol B Machine B Qty: 1 Machine A takes in X units of…
A: The answer as follows
Q: Your score of PDS Lab is determined as follows: Final Score (T) = Marks obtained (M) X…
A: Program description: M, N, and K are the user input float variables used to take the values of marks…
Q: Which among the following is not a method to do unit commitment a. Dynamic programming b. Lambda…
A: In this question, we have to choose one out of four option.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 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 profitof 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 ZERO(‘0’) when the…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…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% whereas 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. The 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…
- The following solidity code segment aim to select a winner at random from the a set of players (assume num_player is the number of players). Explain what is the vulnerability of this method. contract Game { uint winner_ID; uint num_player; function guessing() external{ winner_ID = uint256(block.blockhash(block.number - 1)) % num_player; } }A electricity bill service provider uses a program that computes the monthly bill of customers as follows: Min Rs 50 for up to 120 Units Plus Rs 10 per unit for the next 100 Units Plus Rs 20 per unit for the next 200 Units Plus Rs 40 per units for any unit beyond 500 units Design test cases for above scenario using equivalence class testing technique.In the refrigerator example, suppose the warranty worksas follows. If a refrigerator fails at any time within 5 yearsof purchase, we give the consumer a prorated refund on the$500 purchase price. For example, if the refrigerator failsafter 4 years, we pay the customer $100. If the refrigeratorfails after 3 years, we pay the customer $200. Estimate ourexpected warranty expense per refrigerator sold.
- [Medium] Suppose, you have been given a non-negative integer which is the height of a ‘house of cards’. To build such a house you at-least require 8 cards. To increase the level (or height) of that house, you would require four sides and a base for each level. Therefore, for the top level, you would require 8 cards and for each of the rest of the levels below you would require 5 extra cards. If you were asked to build level one only, you would require just 8 cards. Of course, the input can be zero; in that case, you do not build a house at all. Complete the recursive method below to calculate the number of cards required to build a ‘house of cards’ of specific height given by the parameter. public int hocBuilder (int height){ // TO DO } OR def hocBuilder(height):[Very Hard] 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…Do in C++ programming A game to collecting coins. In level # 1, whenever the player takes a coin, the next coin is automatically blocked with an iron brick. Which coins should the player take in order to maximize his gains? EXAMPLE: COINS IN ORDER 3$ 9$ 2$ 7$ 3$ 6$ 9$ 1$ START COLLECTING COINS = (SKIP 3$) (TAKE 9$) (AUTOMATICALLY BLOCKED 2$) (TAKE 7$) (AUTOMATICALLY BLOCKED 3$) (SKIP 6$) (TAKE 9$) (AUTOMATICALLY BLOCKED 1$) = TOTAL COINS WILL BE 25$ (max coins) In level # 2, the same rules of level 1 apply, but with a twist: the player have a bag that can take only a limited number of coins. Which coins can the player take in order to maximize his gains (provided that the coins fit inside his bag)? fill the code: #include #include using namespace std; unsigned max_coins(vector coins, unsigned capacity) { //code here } int main() { vector coins = {3, 9, 2, 7, 3, 6, 9, 1}; unsigned capacity = 3; cout << max_coins(coins, capacity) << endl;…
- Do in C++ programming A game to collecting coins. In level # 1, whenever the player takes a coin, the next coin is automatically blocked with an iron brick. Which coins should the player take in order to maximize his gains? EXAMPLE:COINS IN ORDER 3$ 9$ 2$ 7$ 3$ 6$ 9$ 1$ START COLLECTING COINS = (SKIP 3$) (TAKE 9$) (AUTOMATICALLY BLOCKED 2$) (TAKE 7$) (AUTOMATICALLY BLOCKED 3$) (SKIP 6$) (TAKE 9$) (AUTOMATICALLY BLOCKED 1$) = TOTAL COINS WILL BE 25$ (max coins) In level # 2, the same rules of level 1 apply, but with a twist: the player have a bag that can take only a limited number of coins. Which coins can the player take in order to maximize his gains (provided that the coins fit inside his bag)? Implement the following function for level# 2 using C++: unsigned max_coins(vector<unsigned> coins, unsigned capacity)For tax purposes an item may be depreciated over a period of several years, n.With the straight line method of depreciation, each year the item depreciates by 1/nth of itsoriginal value. With the double declining balance method of depreciation, each year the itemdepreciates by 2/nths of its value at the beginning of that year. (In the final year it is depreciatedby its value at the beginning of the year.)Write a program using **Visual Basic** that performs the following tasks:1.1 Request a depreciation of the item, the year of purchase, the cost of the item, the number ofyears to be depreciated (estimated life), and the method of depreciation. The method ofdepreciation should be chosen by clicking on one of two buttons.1.2 Display a year by year description of the depreciation.Imagine playing a number guessing game. A side is a number from 0 to Nhe's holding it, and the other side is trying to find that number by taking turns guessing. Number-holding side estimatehe has to offer one of the following three options in response to the party that did it:1-Your guess is correct, you found the number I kept (Game Over).2-Your estimate is wrong, but you are closer to the correct estimate than the previous estimate.3-the wrong estimate and the correct estimate are further away than the previous estimate.To find the estimated number in an environment where all the information is these, astrategy will be followed: Make a prediction (N/2) from the exact middle of N with 1 Begin:Find out the answer to your guess. [answer=answer_ogren (guess)]If the answer is equal to 1, the game is over, you can leave.If the answer is equal to 2, you are going in the right direction, keep the forecast direction;If you're heading for small numbers, the new N is now N/2.Make a guess…