For tax purpose an item may be depreciated over a period of several years. With the straight-line method of depreciation, cach year the item depreciates by (l/n)th of its original value. With the double-declining-balance method of depreciation, cach year the item depreciates by (2/n)ths of its value at the beginning of that year. (Int final year it is depreciated by its value at the beginning of the year). Write a program that perform the following tasks: a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciate d (estimated life), and the method of depreciation. b) Display a year-by-ycar description of the depreciation in a table setting. See Output Examples below: Putrut Exampiss
Q: One day, Fred and his N friends were playing a card game in which each player throws a card with a…
A: Introduction:Here we are given the task of creating a Python system to assist Fred in browsing the…
Q: Using a source-level debugger, determine for what values of argumentsthe function Mystery returns a…
A: Given a code, To check for what values of a, b, and c the function Mystery returns 0.
Q: pick a non-void adjacent substring of s that contains an equivalent number of 0's and 1's; flip…
A: Here have to determine about the Flip and Reverse programming problem statement.
Q: Complete the Team class implementation. For the instance method get_win_percentage(), the formula…
A: Floating point Division is the division in which if one or two sides has a floating point number,…
Q: 8) What is wrong with the following recursive sum method? The method is supposed to sum up the…
A: Please find answer to the above question below:
Q: Given the sequence, S2 = 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, … Write a RECURSIVE method called…
A: note: since the question only has details for sequence2. so only that is implemented here public…
Q: f wchart Wo2 BadDate.spp 2 Term W This is the work of the housekeeping) method W This Is the work of…
A: The flowchart for the code is given below
Q: The following recursive method has been created. This method accepts two integer parameters called a…
A: Step 1 The answer is given in the below step
Q: a) FindMinIterative public int FindMin(int[] arr) { int x = arr[0];…
A: Please refer below for your reference: Time complexitites are below: a) FindMinIterative public int…
Q: public int function ( int num1); public int function ( int num1 , int num2); public double function…
A: I have provided solution for all the 5 parts. NOTE: The approach to solve this is- here just match…
Q: Write a method that sums all the numbers in the major diagonal in an n x n matrix of double values…
A: Note: The below program has been complied and executed in NetBeans IDE 8.2
Q: 15) Why is the following method one which has infinite recursion? public int infiniteRecursion(int…
A: Here the infinite recursion is because the recursive call does not move the parameter closer to the…
Q: This is a repost already and I only need the answer for number 2 This is my code for Euler's…
A: Input : Initial values (x0,y0) Point xn where yn need to calculate Number of steps Output : List…
Q: An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose…
A: 1)using split function split the words whenever u encounter a space 2)check for the words starting…
Q: SUCCESSIVE-OVER-RELAXATION Method TROUBLESHOOTING: Fix the errors in the code below and run the…
A: SUCCESSIVE-OVER-RELAXATION Method TROUBLESHOOTING: Fix the errors in the code below and run the…
Q: 3 .A spherical tank is to be designed as shown below to hold water for a small village in a…
A: Code: import mathpi=math.pi#function to call real functiondef function( h ): return pi*(h * h * h)…
Q: recursionMystery For each call to the following method, indicate what console output is produced: 1…
A: The program is written to find the output of given functions. class Main { publicstaticvoid…
Q: Write the following program in python; There is a class with m number of students and they have n…
A: Objective: This program develops a class with an 'm' number of students and an 'n' number of…
Q: Let P be “this book is a non-fiction book” and Q be “the ideas in the book is consistent with…
A: q: Consider a case where both P and Q are false (e.g. a fantasy novel and an unrealistic phenomenon…
Q: private: int x, у;
A: Corrected Program: #include<iostream.h> #include<conio.h> class Point { private: int…
Q: Question:Write the method in java for following a)Method returns a translated point b) Method…
A: a. Java Translated point I Know there is this method; pt.translate(int x, int y); But is there this…
Q: Question 3 Write a program that finds the equivalent series and parallel resistance for a collection…
A: The pseudocode is mentioned in step 2 and flowchart has been attached in step 3. I hope you find the…
Q: Problem 4: Magic Square Test A magic square of order n is an arrangement of n × n numbers, usually…
A: Note: Programming language not mentioned in the question. C++ is chosen for implementation.…
Q: Complete the method definition to output the hours given minutes. Output for sample program: 3.5…
A: Here I have first of all created a class named HourToMinConv, and in this class, I have created a…
Q: The following recursive method is created public static void t(int a) { if (a < 250)…
A: Code should be placed for the numbers are: 1: t 2: a 3: / 4: 2 Replacing the numbers we get:…
Q: Compute and return the average speed of a car, given the distance traveled (as type double) and…
A: Note: Here you didn't mention any programming language so we are creating the method code in the C++…
Q: One day, Fred and his N friends were playing a card game in which each player throws a card with a…
A: Required: We have to write a code to maximize the sum which we get on the front cards, keeping in…
Q: Compute the combinations of n things taken k at a time using both iterative and recursive methods.…
A: Please give positive ratings for my effort. Thanks. ANSWER public class Combination { private…
Q: T/F 6. Consider the following recursive sum method: public int sum(int x) { if (x == 0) return 0;…
A: Program: #include <iostream>using namespace std;int sum(int x){if (x == 0) return 0;else…
Q: c# Now, modify the program so that the major functions appear in the following individual methods:…
A: modify the program so that the major functions appear in the following individual methods: GetMonth…
Q: Using the class "c1" given below write a COMPLETE CODE for the two methods "sum" and "multiply"…
A: The objective of the program is to write two methods called multiply and max. float multiply(int ):…
Q: you need to add methods after every case so that after every function like withdraw, deposit, and…
A: public class BankTeller{ public static void main(String[] args) { int balance=1000,…
Q: Problem 2: Write recursive definition of a method named Combinations that takes two integers n and r…
A: C++ program to implement a recursive function that returns the total number of unique combinations.
Q: Given a student's name and three test scores (of type int), print the student's name and average…
A: Actually, program is an executable software that runs on a computer.
Q: For questions 1 – 2, use the following recursive method. public int question1_2(int x, int y) { if…
A: Given that, Calling this method will result in infinite recursion if which condition below is…
Q: You will be given an array A of length n. Write a method to calculate the following value of X using…
A: The code is written below in java- import java.lang.*; // importing packages import java.util.*;…
Q: from a fishing excursion. The I-th angler has gotten a fish of weight man-made intelligence.…
A: Here have to determine about the Emotional Fishermen programming problem statement.
Q: Write a method to add two matrices. The header ofthe method is as follows:public static double[][]…
A: A required Java program is as follows, File name: “MatrixSum.java” import java.util.Scanner; public…
Q: Trace through the following program and Show the Ol public class Employee { private static int empID…
A: public class Employee{ private static int empID = 11111; private String name, position;…
Q: An isolated hydrogen atom emits a photon of x eV. Your task is to find the momentum of photon…
A: Required:- Given the atomic number of atom: 5 and we have to find the energy required to remove the…
Q: One day, Fred and his N friends were playing a card game in which each player throws a cardwith a…
A: Input/Output Explanation: An integer N denoting the number of cards(1<=N<=500) An integer…
Q: 1) Write a simple program whose main method will repeatedly ask the user for an integer number and…
A: The program reads the input stores it into variable. It then calls the isPrime function and stores…
Q: Java Program: Recursive Method There are n people in a room where n is an integer greater then or…
A: Introduction : Here we have to write a recursive method to solve the above problem.
Q: Exercise 4 Write a recursive method that returns the power x". Test your method.
A: Please find the answer to the above questions below:
Q: Find and correct error(s) in the following method definition: public static void doubleNum (int x)…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
NEED HELP WITH PYTHON CODE. AND PLEASE PROVIDE DETAILS ON HOW AND WHAT DID YOU USE FOR YOUR WORK SEPARATELY.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- The fuel economy of a car is the distance which it can travel on one litre of fuel. The base fuel economy (i.e., its fuel economy when there is only one person - the driver - in the car) of a certain car is MM kilometres per litre. It was also observed that every extra passenger in the car decreases the fuel economy by 11 kilometre per litre. PP people want to take this car for a journey. They know that the car currently has VV litres of fuel in its tank. What is the maximum distance this car can travel under the given conditions, assuming that all PP people always stay in the car and no refuelling can be done? Note that among the PP people is also a driver, i.e., there are exactly PP people in the car. Solve in any programming languageA person places $5000 in an account that accrues interest compounded continuously. Assuming no additional deposits or withdrawals, how much will be in the account after seven years if the interest rate is a constant 8.5 percent for the first four years and a constant 9.25 percent for the last three years?Suppose that the grading of x University courses is as follows:• Each student can get grades between 0 and 100.• If the student's grade is less than 40, the student is informed that the course failed (Unsuccessful).• If the student's grade is higher than 40,o The difference between the student's current grade and the number that is a multiple of 5 higher than the closest to his / her grade is less than 3.If it is lower, the student's grade is equal to the 5 fold higher than the closest one.o If the difference is 3 or more than 3, no change is made in the grade of the student.In this context, the updated grades of the students are calculated according to the entered student gradesWrite the Java code showing.Solve this question in c ++ language.ü Define the section to be calculated as Java object ("Question1").ü Question1; Take the note string as input.public Question1 (int [] input)ü Print out the updated notes as a series after the calculation is madeo public int [] gradingStudents…
- Suppose that the grading of x University courses is as follows:• Each student can get grades between 0 and 100.• If the student's grade is less than 40, the student is informed that the course failed (Unsuccessful).• If the student's grade is higher than 40,o The difference between the student's current grade and the number that is a multiple of 5 higher than the closest to his / her grade is less than 3.If it is lower, the student's grade is equal to the 5 fold higher than the closest one.o If the difference is 3 or more than 3, no change is made in the grade of the student.In this context, the updated grades of the students are calculated according to the entered student gradesWrite the Java code showing.ü Define the section to be calculated as Java object ("Question1").ü Question1; Take the note string as input.public Question1 (int [] input)ü Print out the updated notes as a series after the calculation is madeo public int [] gradingStudents ()Code sample:public class Question1…There are a number of plants in a garden. Each of the plants has been treated with some amount of pesticide. After each day, if any plant has more pesticide than the plant on its left, being weaker than the left one, it dies. You are given the initial values of the pesticide in each of the plants. Determine the number of days after which no plant dies, i.e. the time after which there is no plant with more pesticide content than the plant to its left. Example // pesticide levels Use a -indexed array. On day , plants and die leaving . On day , plant in dies leaving . There is no plant with a higher concentration of pesticide than the one to its left, so plants stop dying after day . Input Format The first line contains an integer , the size of the array .The next line contains space-separated integers . Constraints Sample Input 7 6 5 8 4 7 10 9 Sample Output 2 Explanation Initially all plants are alive. Plants = {(6,1), (5,2), (8,3), (4,4), (7,5),…Consider the following case study: "Springfield University offers a number of courses. A course contains a number of units. Students enrol and elect a set of units every semester. Students are allowed to enrol in a maximum of 5 units in any given seme ster. They can only be enrolled into a single course at any given point in time. However, over a student's lifetime, they may undertake a number of different courses. Each unit has a set fee that is set at the start of the semester. This fee is to be paid up-front in full by the students once enrolled. Some units have pre-requisite unit requirements. Some units have co-requisite unit requirements. To be enrolled in some courses, you must have completed a certain course (e.g. to enrol into a Postgraduate course, you must have an Undergraduate degree)." Noun (bold)/verb (underline) analysis on the case study is marked for you to identify candidate classes, attributes, operations. Now, draw the domain model for the above case study.
- In a recent court case, a judge cited a city for contempt and ordered a fine of $2 for the first day. Each subsequent day, until the city followed the judge's order, the fine was squared (i.e., the fine progressed as follows: $2, $4, $16, $256, $65,536, .). a, What would be the fine on day N? b. How many days would it take for the fine to reach D dollars (a Big-Oh answer will do)? 2.6Incident Computation The sum of the years “at risk” of these 12 courses is 102 students-years, and there were 3 occurrence of disease. We can now compute the incident rate: (One decimal place only. No need to include “%” sign to your answer.)It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2500.a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself once, another…
- It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e. 200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2500.a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself once, another…3. A technician takes X hours to visit the stores in a couple of streets in one shift, and when he finishes his tour, another technician revisits the same stores again, needing other X hours to finish the second shift, and so on. For example, if the first technician started his shift at 1:00pm, he finishes it at 7:00pm and the second technician starts his shift at 7:00pm and finishes it at 1:00am, and so on. The supervisors used to make a quick meeting with all technicians twice a day at 1:00 am and 1:00 pm, so they need to finish their tours exactly 1:00. Identify the mathematical notation for the number of shifts should be made by the technicians in order to achieve this, write the name of this mathematical value, and find it for two tours, one with X=7 and another with X = 11 .Workers at a particular company are paid at a rate of 150.00 per hour for up to 40 hours of work at hour over that is paid at a rate of 1.5 times the normal rate. From the worker’s gross pay, 14% is withheld for income tax, 5% withheld for social security system tax, and 13% is withheld for state income tax. An additional 10% is withheld if the worker has 3 or more covered dependents to cover extra cost of health insurance. Draw the flowchart and code the C program that outputs the worker’s gross pay, each withholding and the net take home pay for the week.