WHILE travelling in a train you observe some colleges student pulling the alarm chain simply to get down at the desired point .Out of students m>=n times student pull the chain .You have to print according to following: 1 If m is >=80 of n then print strict action is required to restrict this event
Q: Python tic tac toe. Tic tac toe is a very popular game. Only two players can play at a time. Game…
A: Algorithm: Start Make a board using dictionary in which keys will be location and values will be…
Q: Object Reward Weight A 20 1 B 5 10 D 40 8. 15 7 25 4 7 2 Maximum weight = 12 The above problem is a…
A: Here we perform genetic algorithm:…
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: Mr. White and Pinkman earned money from their first drug contract. There is an N type of dollar such…
A: Explanation: First line will contain T, number of testcases. Then the testcases follow. Each…
Q: chen of his school departme he kitchen to make espresso and latte for students seeking energy study.…
A: Explanation: Firstly we have taken input from the user value of 'n' and 's' using cin. And then made…
Q: Suppose, you have $10 to buy food for a day. You have several options, but you need to maximize…
A:
Q: In this challenge. we're getting started with conditional statements. Check out the Tutorial tab for…
A: I have written C++ code for following question:
Q: An electronic shop wants you to write a program to take orders from the clients and print the…
A: while changing from input type to number to string, make sure you clean the unwanted spaces in the…
Q: Let P(x,y) be the statement “x and y work at the same company” and Q(x,y) be the statement “x and y…
A: ((x≠y)∧P(x,y)∧Q(x,y)) it means, (x and y are two different employee) and (x and y works in same…
Q: For the following predicates: E(x.y): y is the employee of x W(x): x <works at a book shop Which of…
A: I think ,here the answer will be first option.(a)
Q: Show that p v q and !q > p are equivalent b. Use the result from part (a) to write a statement that…
A: Here in this question we have given two parts..in the first one we have asked to show that two…
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: Polycarp is altering a convoluted PC program. To begin with, factor x is pronounced and alloted to…
A: Here have to determine about the Forbidden Value programming problem statement.
Q: Q1\A) A paint company is trying to recycle unpopular paint colours by mixing them together to create…
A: The solution is given below:
Q: A job ad for Gaggle Inc. says: It is necessary to major in either math, computer science, or…
A: Since this is a multiple question as per guideline we are solving only one please repost the…
Q: You have N dollars and you have a list of k items L1, ..., Lk that you wish to purchase from an…
A: The answer to the above-given question is given below.
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: 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: Jhon and Tom earned money from their first drug contract. There is an N type of dollar such as A1,…
A: The Answer is
Q: Q2: Replacement is a very generous institute that provides a Bonus monthly salary to their employees…
A: ANSWER:-
Q: Jhon and Tom earned money from their first drug contract. There is an N type of dollar such as A1,…
A: def solve(coins,chance): # idx for coin array # idy for chance array idx, idy = 0, 0 # intialize…
Q: Let P: If Tom whistle, Jerry shoot the Ball.; Q: If Tom eat bread, Jerry will leave the game. Now if…
A: As only P is true and Q is false, Then Jerry shoot the ball when Tom whistle is true also also as Q…
Q: Write a C program to find out year in which Mr. Kavi was born from the following information: Kavi…
A: C program is give below find out year in which Mr. Kavi was born according to the given inputs.
Q: A corporation named XYZ needs a program to calculate how much to pay their part-time and full-time…
A: The program code is : - for XYZ company : class Employee: def…
Q: Bianca is preparing special dishes for her daughter’s birthday. It takes her a minutes to prepare…
A: programming language is not mentioned we are giving solution in c++
Q: Alex is playing Poker card game. He starts with a deck of N cards, where for each valid (i), the ith…
A: Given:
Q: Jhon and Tom earned money from their first drug contract. There is an N type of dollar such as A1,…
A: Input/Output Explanation: First line will contain T, number of testcases. Then the testcases…
Q: Let I(x) be the statement "x has an Internet connection" and C(x, y) be the statement "x and y have…
A: Answer: Ix∧Iy→cx,y ∃xIx∧¬Cx,y
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: In a Chess match "a + b", each player has a clock which shows a minutes at the start and whenever a…
A: Note: Programming language in not mentioned so doing in java In this question, we are asked to write…
Q: Let p be the statement "I celebrate" and q be the statement "Bangladesh wins". [Hint: The following…
A: The inverse of p->q is ~p -> ~q. Given p = "I celebrate" q = "Bangladesh wins"
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: Both players have to make substrings using the letters of the string S. Stuart has to make words…
A: Here is the PYTHON code as required I have kept it very simple to understand
Q: 2. You have to design a vending machine for a 4 Tk product. The vending machine can only accept…
A: It is defined as a interpreted, object-oriented, high-level programming language with dynamic…
Q: Let S(x) = "x is a student in our class" and P(x) = "x lives in Wahiawa" a. Assume the u.d. for x is…
A: The answer is given below...
Q: described Mancala variant in C++ in the pictures. Player 1 will be a human while the other will be a…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: It can be said that statement P is a necessary condition for statement Q if Q ⇒ P is true. In other…
A: Introduction: A prime number is a natural number greater than 1 that is not a product of two smaller…
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: Given four positive integers a, b, c, and d, compute the sum of those among them that are odd.…
A: A Java program that computes the sum of those among the given integers that are odd without using…
Q: Alex is playing Poker card game. He starts with a deck of N cards, where for each valid (i), the ith…
A: Given:
Q: I need to write a program for a Lion Hunt. The program should calculate the number of hours it will…
A:
Q: (1) Let p: "I finish my Work" q: "I play handball" r: "The sun is shining" s: "The humidity is low"…
A: 1.
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: An amortization calculator is used to determine the periodic payment amount due on a loan (typically…
A: A = P(i + i/((1+i)^n-1)) where, A = periodic payment amount. P = amount of principle. i = periodic…
Q: Python tic tac toe. Tic tac toe is a very popular game. Only two players can play at a time.…
A: import os import time board = [' ',' ',' ',' ',' ',' ',' ',' ',' ',' '] player = 1…
Q: A move in Tic-Tac-Toe can be defined using two values, the position (i.e., number between 1 and 9…
A: Tic-Tac-Toe is a very simple two-player game. So only two players can play at a time. This game is…
Q: You are given an exam with questions numbered 1, 2, 3, . . . , n. Each question i is worth pi points…
A: Given that: Let S(i) be the highest possible cumulative score from questions I through n. Any such…
WHILE travelling in a train you observe some colleges student pulling the alarm chain simply to get down at the desired point .Out of students m>=n times student pull the chain .You have to print according to following:
1 If m is >=80 of n then print strict action is required to restrict this event
Step by step
Solved in 2 steps with 1 images
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)In a Chess match "a + b", each player has a clock which shows a minutes at the start and whenever a player makes a move, b seconds are added to this player's clock. Time on a player's clock decreases during that player's turns and remains unchanged during the other player's turns. If the time on some player's clock hits zero (but not only in this case), this player loses the game. N+1 There's a 3 + 2 blitz chess match. After N turns (i.e. moves made by 2 N white and moves made by black), the game ends and the clocks of the two 2 players stop; they show that the players (white and black) have A and B seconds left respectively. Note that after the N-th turn, b = 2 seconds are still added to the clock of the player that made the last move and then the game ends. Find the total duration of the game, i.e. the number of seconds that have elapsed from the start of the game until the end.Scenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))
- Control Loops: A high school 1000 students and 1000 lockers. The principal plays the following game: She asks dthe first student to open all the lockers. Shen 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 remaining students continue this game . In general, the nth student checks every nth locker. If the locker is open, the student closes it; if it is closed, the student opens it. After all the students have taken their turns, some of the lockers are open and some are closed. Write a program thatprompts the user to enter the number of lockers in a school. After the game is over, the program outputs the number of lockers and the locker numbers of the lockers that are open. Test run your program for the following inputs: 1000, 5000, 10,000. Do you see any pattern developing for the locker numbers that are open in the output?…A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a fish is swimming past if:there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call "Fish Rising"), orthere are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call "Fish Diving"), orthere are four consecutive depth readings which are identical (which we will call "Constant Depth").All other readings will be considered random noise or debris, which we will call "No Fish."Create a Python program called "fishfinder_firstname_lastname" that takes 1 input of string of 4 numbers separated with comma. Your program must display "Fish Rising", "Fish Diving.", "Fish At Constant Depth" or "No Fish".Example:30,10,20,20 Must display No…A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend offered help to create a program they can use. The program contains 3 options, 1st option is for Permutation, 2nd option is Combination and 3rd is for terminating the system. For option 1, Permutation, they uses the following formula: nPr = ; where r must not be greater than n. It should not proceed if this condition is not met. For 2nd option, Combination, they uses the formula : nCr = ; where r must not be greater than n as well. For the 3rd option, the program owner’s information shall be displayed, like name, subject code and account number, before the program terminates.
- Write the pseudocode for the following scenario: A manager at a 2nd hand car dealership wants to keep track of the amount (in Rands) of commission paid to the sales people. You must take the following into consideration: • There may be more than one salesperson (each salesperson has a unique employee code)– input the employee code. An employee code of zero (0) terminates the program. • The salesperson’s commission is based on their sales (in Rands) in the past month- input the sales for each salesperson. • Calculate the total car sales (in Rands). • Calculate a salesperson’s commission (in Rands). Commission is based on the following table: Total value of cars sold Percentage commission earned Less than or equal to R500 000 10% More than R500 000 15% • Calculate the total commission the manager must pay to all of the salespeople. • Display a report for the manager in the following format: Employee Code: 2 Sales: R400000 Commission: R40000 Employee Code: 4 Sales: R650000…An employee uses the following coding logic for the company’s resource access: String result = authenticate( . . . ) ; if(result.equals (ACCESS DENY) ) // do stuff after authentication fails e l s e // do stuff after authentication succeeds Suppose values returned by the authenticate function include ACCESS OK and ACCESS DENY. Is there a security flaw in the program? If so, explain and rewrite the code.In cold weather, meteorologists report an index called the windchill factor, that takes into account the wind speed and the temperature. The index provides a measure of the chilling effect of wind at a given air temperature. Windchill may be approximated by the formula: W 5 13.12 1 0.6215* t 2 11.37 *v0.16 1 0.3965 * t *v0.016 where v 5 wind speed in m/sec t 5 temperature in degrees Celsius: t <= 10 W 5 windchill index (in degrees Celsius) Write a function that returns the windchill index. Your code should ensure that the restriction on the temperature is not violated. Look up some weather reports in back issues of a newspaper in your university library and compare the windchill index you calculate with the result reported in the newspaper.
- A/if y=sin(x), z=cos(x), v=y+x, where (-100 ≤x≤ 100) could you plot y, z, v as shown below: 100 D 20 30 35 15 20 25 30 35 40 45 40 50 0 -50 100 05 0 -0.5 5 10 10 20 50 D A 10 40Exercise III: Catalan numbers For n e N, denote by c, to be the number of ways to form a "mountain range" with n upstrokes (U) and n downstrokes (D) that all stay above a horizontal line. For instance: for n = 1, only UD is allowed, so c = 1; • for n = 2, only UUDD and UDUD are allowed, so c2 = 2. 1. Check that c3 = 5 by writing down or drawing all possible options. 2. Consider the power series +00 g(x) = 2 n=0 (by definition co = 1) called the generating function of the sequence (en). Justify that cn < 4" for each n, and deduce that the radius of convergence of g is at least 1/4. 3. It can be show that for r E (-1/4, 1/4), g(x) = 1+ xg(r)? and therefore 1- VI 4.x g(x) = 2.x Use this formula and the known power series of V1+ x to write the first terms of the power series expansion of g, in the form g(x) = co + c1x + c2x2 + C3x + c4x* + ·.. Show how you obtain a few terms, but you do not need to show all computations and you can use a calculator for fractions. Check that you recover co,…Assume you work as a cashier in a restaurant. You must keep track of the amount of money your restaurant earns each day and report it to your boss. If a customer purchases something, that amount is added to the daily income book.Take a customer's order and if a customer enters an "X," the order is complete, and print "Total cost of the items: ". In this way, 3 customers can order at maximum as your restaurant only serves three customers per day; after the service, print the day's total income; if the total money exceeds 500tk, print "Great Work". Otherwise, print "Do Best Next Day."Note: Write a function called “take_order()” that asks users to input food names, calculate the amount and show it to the customer. When the last customer buys, you need to also calculate the total income of the day and show it at the end. Assume that no customers enter invalid food names.The Dictionary ‘price_list’ is set for you and use it in the code for your convenience.price_list={'Juice':30, 'Fried…