5. The formula for computing the final amount if one is earning compound interest is given on Wikipedia as calculating number ot years nt e A = P(1+-) Amount Where, number of times the interest i compounde d per year Annual nonmi nal interest rate as adecimal • P = principal amount (initial investment) • r= annual nominal interest rąte (as a decimal) (OCcurs, oncE every yers • n=number of times the'interest is compounded per year • t = number of years P= 10000 Pミ12 E 0.08 Write a Python program that assigns the principal amount of R10000 to variable p, assign to n the value 12, and assign to r the interest rate of 8%. Then have the program prompt the user for the number of months t that the money will be compounded for. Calculate and print the final amount after t months. t= int cinput c"what is the number Ok month that the morey will be Compounded for ?")
Q: Question 3: K = [3 5 7;2 6 X2;X1 9 X1] A. K(2,2:end) B. K(end, 1) C. K(:,3)=[] D. K' E. sum(diag(K))…
A: x1=4x2=4k=[3 5 7 ;2 6 x1; x1 9 x1] disp("executing query A")k(2,2:end) disp("executing query B")…
Q: Q1:Answer the following (you are free to assign the variables) (E ) sqrt(x)+abs(-20) S=…
A: 1. x, y, i are the variables. 2. = operator is used to assigning the value. 3. assigning 7 value to…
Q: b) Given the constants and variable declarations: #define PI 3.14159 #define MAX I 1000 double x, y;…
A: b. Given a=3 b=4 i an integer x,y double type y=-1.0 PI=3.14159 MAX_I = 1000 Statement Valid/Not…
Q: Draw each of the Following associations using Mathe matica or another Program2 L I-1. () = I. sind…
A: Answer: I have given answered in the handwritten format in brief explanation
Q: The price of 2 liters of milk was R14.99 in 2014. Using a rate of inflation of 6.3% per year,…
A: Option d is incorrect since the price is initialized to a constant. This means that the algorithm…
Q: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to…
A: Start Input year If year is multiple of 4 If year is multiple of 100 If year is multiple of 400,…
Q: Python Programming
A: For the given python code below are the explanation, output: - In the given code various functions…
Q: This is to use Python Relating to the previous question. The list with building names 'Richard…
A: A Python program for the given criteria is as follows, File name: “main.py” #Create a list names=[…
Q: Choose the correct answer to fill the blanks in the following. questionsملاحظة: اختار الأجابة…
A: Here, we are going to find the sum of given series for first 10 terms.
Q: Part 1: Computer-Assisted Instruction (CAI) refers to the use of computers in education. Write a…
A: A function num_for_dif_1() is used to return single digit number for multiplication along with the…
Q: 1. Examine the following C statements correct or error, write down your answers on the answer sheet…
A: Solution :- Error Rules for variable name in C are as follow It can only contain letters…
Q: Using C++ common year in the modern Gregorian Calendar consists of 365 days. In reality, Earth…
A: Logic:- check for leap year logic. If userYear%400==0 then it is leap year simply return 1 from…
Q: 1. Count the number of per character in a given sentence/paragraph. (“Hello World!” H-1, e-1, l-3,…
A: 1) import java.util.Scanner;import java.util.HashMap;import java.util.Set;public class A{ public…
Q: Ahmad is a new student in AAU university, he is registered 13 hours in his first semester. C++,…
A: I give the code in CPP(C++) along with output and code screenshot
Q: 4(c). Consider the following football clubs, their points and position in the English Premier…
A: Use an enum to store the club names and two different arrays to store points and position Then…
Q: Develop a program that will read the following marks as inputs:…
A: Here, Program instructions are given.
Q: From 1 to 9, ang multiples of 3 are: 3, 6, 9. Ang sum ng 3 + 6 + 9 is 18. So, ang sum ng lahat ng…
A: The above question is solved in step 2 :-
Q: Write a C# program that accept a student biodata; names, age, sex and address. You should also do…
A: The detailed answer is given below:
Q: Assume you work as a cashier in a restaurant. You must keep track of the amount of money your…
A: Solution:-- 1)The given question has required for the solution to be provided with the help of an…
Q: 5. Let all the numbers in the following calculations be correctly rounded to the number of digits…
A: Algorithm: Start Calculate a=1.3214+1.937 Calculate b=6.354/0.034 Calculate c=pow(2.23,0.432) Using…
Q: Question 4 Part i The checksum letter of a 7-digits number is calculated as such: d - [Ci iz is is…
A: Solution :: Program 1 - def get_id_checksum(s): # implementing look-up table using…
Q: using this c++ code, can u change it a little bit into printing simulating. instead num_minutes 20,…
A: Code: #include <stdio.h>#include <stdlib.h>#include <time.h>#include…
Q: In the presidential elections for the United States of America, there are two types of votes: 1.…
A: Declare the class candidate and define the variables from file in it . Ask the user to enter the…
Q: Let P denote the set of prime numbers. Consider the following statement S: (Vp E P)(3n, m e N) (p=…
A: THe solution for the above given question is given below:
Q: Print the distance covered by each car after each hour. After 10 hours, the car with highest…
A: public class AutomaticCar { private String model; private int year; private int speed; private int…
Q: 1. How many courses will you have on the first day? 2. If you want to attend courses only 2 days…
A: as per our guidelines we are supposed to answer only 3 sub-parts, please repost the remaining part…
Q: 5. Using the following definition of O notation, evaluate if f (n) = 3n + 2 E 0(nlog(n)) ? (To…
A: Please give positive ratings for my efforts. Thanks. ANSWER Here, f(n) = 3n + 2 g(n) = n…
Q: Determine if the following form of an argument is valid or not. And indicate the law or fallacy used…
A: In this question, we are going to check given arguments using laws of Algebra of Propositions are…
Q: 4. (a) (i) What is the smallest positive number that can be written in normalised scientific…
A: The answer of these is given below.
Q: Determine whether the following argument is valid or invalid. Include a truth table and a few words…
A: Here, I have to provide a solution to the above question.
Q: Total Occurrance Given two integer numbers input1 and input2, find the total number of occurrences…
A: Code: import java.util.Scanner;public class DemoCount { public static int findTotalOccurrence(int…
Q: Read the following program and answer the following Questions for(i=N; j>=1;i--) cout<<j<<"\t";…
A: For the above given program we want to find the value of multiplication of the series if (N = 5),…
Q: 3. Write a complete program following the algorithm given below. 3.1 Declare identifier of integer…
A: Since the programming language is not mentioned I have coded this using Python 3.
Q: Choose the line of code that has the logic error: /** * Simple linear income tax calculator based on…
A: For income less than $100.000 i.e LEVEL_3_INCOME, the TAX_RATE is 0.20. In line 31 and 32, the…
Q: Under computer integer arithmetic, the quotient J/K of two integers J and K is less than or equal…
A: Under computer integer arithmetic, the quotient J/K of two integer J and K is less than or equal to…
Q: x² – 3xy + y2 = A iven the system of equations { where A = 2 and B = 8 x² + y? = B ind the third…
A:
Q: All healthy people eat an apple a day. Keisha eats an apple a day. :. Keisha is a healthy person. O…
A: Given, All healthy people eat an apple a day. Keisha eats and apple a day. Therefore, Keisha is a…
Q: 3. Evaluate the following expressions: a. abs(5); _______________________________ 88 b. floor(5.5);…
A: a. abs(5); __________5_____________________b. floor(5.5); __________5_____________________c.…
Q: 2. Determine if the following arguments are valid or invalid by writing and then comparing it:…
A: (a):- The given argument is valid. Since it is very clear that if shaun Murphy is a doctor then only…
Q: Homework 2: 1 x (t) = sin(5000z), I =- sec 8000 Determine x, (t), x (n), X(jQ), X, (j) and X (e)…
A: Answer..
Q: S1 = 'abcdefgh' S2 = S1 S1 = S1.replace('b', 'k') The value of the expression S1 == S2 is O True O…
A: The correct answer is False. replace() method in Python replaces a specified string with another…
Q: 3.6 LAB: Leap year A year in the modern Gregorian Calendar consists of 365 days. In reality, the…
A: The program approach: The program will take in a user input for year. It will then check the input’s…
Q: In the presidential elections for the United States of America, there are two types of votes: 1.…
A: The three classes fstream, ifstream, and ofstream, which are provided in the fstream headerfile, are…
Q: 1. Write the JS Code for the following Programs Name Father Name Saif Ur Rehman Muhammad Abdullah…
A: Program Approach: Create form using Form tag Use label and input tags to create label text and…
Q: If f(n) is the number of times that y=y+A[i]; is executed in the code segment below, which of the…
A: Time complexity describes how much time a code takes to execute.
Q: QN R = Q, where Q is the set of rational numbers and R is the set of real * .numbers true False
A: Since Q ⊂ R So the Q ∩ R = Q
Q: Homework 2: 1 x (t) = sin(5000), I = sec 8000 Determine x, (t), x (n), X¸(jQ), X¸(j) and X (e¹ª)…
A:
Q: Question 12. The powers of 2 (2º = 1, 2' = 2, 22 = 4, etc) are referenced regularly in computer…
A: ANSWER 1
Q: Our first day of class, February 18, is the 49th day of the year. Divide 49 by 365, multiply the…
A: Here I have asked the user to enter the day of the year. Then I have divided the input by 365 and…
Q: The following are formulas for calculating the training heart rate (THR): THR=(MHR-RHR) × INTEN +…
A: age=input('Enter Age : ');gender=input('Enter Gender (M/F) : ');if gender== 'M' g="male";…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- The factorial function f(n) = n! is defined by n! = 1 2 3... n whenever n is a positive integer, and O! = 1. Provide big-O estimates for the factorial function and the logarithm of the factorial function. As an illustration, 1! = 1, 2! = 1 2=2, 3! = 1 23 = 6, and 4! = 1 234=24.Take note of how quickly the function n! expands. Consider the following: 20! = 2,432,902,008,176,640,000.Q 1.Consider the following functions f1 and f2:int f1(int n) { if (n == 0) { return 1; } else { return f2(4, f1(n – 1)); }} int f2(int n1, int n2) { if (n1 == 0) { return 0; }else { return n2 + f2(n1 – 1, n2); }} a. Evaluate the value of f1(7)? b. Analyze the computational complexity of the f1 function expressed in terms of big-O notation?phyton 3#use if, elif or else In a company, the net salary of employees is a function of two discounts: the social security contribution and the income tax. Given the employee's gross salary, social security contributions are paid according to the following table: Gross salary aliquot Up to $ 1,659.38 8% From $ 1,659.39 to $ 2,765.66 9% From $ 2,765.67 to $ 5,531.31 11% Above $ 5,531.31 Fixed discount of $ 608.44 After discounting the social security contribution, the remaining amount is then used to calculate the income tax discount, based on this table: Base salary Discount rate Up to $ 1,903.98 Exempt From $ 1,903.99 to $ 2,826.65 7.5% From $ 2,826.66 to $ 3,751.05 15% From $ 3,751.06 to $ 4,664.68 22.5% 22.5% Above $ 4,664.68…
- phyton 3#use if, elif or else In a company, the net salary of employees is a function of two discounts: the social security contribution and the income tax. Given the employee's gross salary, social security contributions are paid according to the following table: Gross salary aliquot Up to $ 1,659.38 8% From $ 1,659.39 to $ 2,765.66 9% From $ 2,765.67 to $ 5,531.31 11% Above $ 5,531.31 Fixed discount of $ 608.44 After discounting the social security contribution, the remaining amount is then used to calculate the income tax discount, based on this table: Base salary Discount rate Up to $ 1,903.98 Exempt From $ 1,903.99 to $ 2,826.65 7.5% From $ 2,826.66 to $ 3,751.05 15% From $ 3,751.06 to $ 4,664.68 22.5% Above $ 4,664.68…A common year in the modern Gregorian Calendar consists of 365 days. In reality, Earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400; therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines the number of days in February for that year. Ex: If the input is: 1712 the output is: 1712 has 29 days in February. Ex: If the input is: 1913 the output is: 1913 has 28 days in February. Your program must define and call the following method. The method should return the number of days in February for the input year.public static int daysInFeb(int userYear) A common year in the…A common year in the modern Gregorian Calendar consists of 365 days. In reality, Earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400; therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines the number of days in February for that year. Ex: If the input is: 1712 the output is: 1712 has 29 days in February. Ex: If the input is: 1913 the output is: 1913 has 28 days in February. Your program must define and call the following method. The method should return the number of days in February for the input year.public static int daysInFeb(int userYear)
- A common year in the modern Gregorian Calendar consists of 365 days. In reality, Earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400; therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines the number of days in February for that year. Ex: If the input is: 1712 the output is: 1712 has 29 days in February. Ex: If the input is: 1913 the output is: 1913 has 28 days in February. Your program must define and call the following function. The function should return the number of days in February for the input year.def days_in_feb(user_year)A common year in the modern Gregorian Calendar consists of 365 days. In reality, Earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days. An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400, therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712 and 2016 Write a program that takes in a year and determines the number of days in February for that year Ex If the input is 1712 the output is: 1712 has 29 days in February. Ex: If the input is: 1913 the output is: 1913 has 28 days in February. Your program must define and call the following function. The function should return the number of days in February for the input year. def days_in_feb (user_year)A university assigns student IDs of the form 1, 2, 3, ... such that if n students are currently enrolled, then the next student to enroll will receive and ID of n + 1. Consider the following algorithm that accomplishes this. // Global variable storing number of students currently enrolled current_student_count = 0 // Function that reads the above global variable, calculates new ID, and increments the global count assign_new_id(): count = current_student_count new_id = count + 1 current_student_count = count + 1 return new_id (a) If two different threads run the above code in parallel to enroll two different students, it is possible for the two students to receive the same ID, and for the current_student_count to have a wrong value. Explain how this is possible. (b) Modify the code above so that the problem in (a) does not happen.
- The 10 Richest People in the World 2023 Rank Name Age Wealth ($bil) Wealth per year 1 Bernard Arnault & family 74 211 2 Elon Musk 51 212 3 Jeff Bezos 59 213 4 Larry Ellison 78 214 5 Warren Buffett 92 215 6 Bill Gates 67 216 7 Michael Bloomberg 81 217 8 Carlos Slim & family 83 218 9 Mukesh Ambani 65 219 10 Steve Ballmer 67 220 Total Average 1 Create a formula to work out the wealth per year for each person. To do this…3. It can be said that statement P is a necessary condition for statement Q if Q ⇒ P is true. In other words, in order for Q to be true, it is necessary that P must be true. Let x be an integer. Give a necessary but not sufficient condition on x for x+5 to be a prime number. Justify your answer. Note: You should give a condition related to x, but not picking one specific number for x.You are given an exam with questions numbered 1, 2, 3, . . . , n. Each question i is worth pi points and has a frustration score fi . You must answer the questions in order, but you may choose to skip some questions. The reason you might choose to do this is that even though you can solve any individual question i and obtain the ???? points, some questions are so frustrating that after solving them you will be unable to solve any of the following fi questions. Suppose that you are given the pi and fi values for all the questions as input. Devise an efficient algorithm you can for choosing a set of questions to answer that maximizes your total points, and compute its asymptotic worst case running time as a function of n.