1 1 f(n) = 3 %3D 8 15 n(n + 2) Write a test program that displays the following table: f(n) 2 0.458333 4 0.566667 12 0.675824 14 0.685417 +
Q: 1. a)Correct code to output the following: 0 2 4 6 8 10 12 14 16 18 b) then rewrite the code so…
A: Correct code: int[] numbers = new int[10]; for(int i=0; i < numbers.length; ++i)…
Q: Write a program that reads maximum 100 integers entered by user ranging from 1 to 9 and displays the…
A: Here is the python program for above implementation. See below step.
Q: Write a program that takes any number of integers as input, and outputs the average and max.
A: The if condition in the given code will produce the error as TypeError as the max variable is a…
Q: Read the following program and answer the following Questions for(i=N; j>=1;i--) sout<<i<<"\t";…
A: Code: #include <iostream> using namespace std; int main(){ //declaring and initialising…
Q: 344614.2214230.qx3zqy7 2 def double_pennies (num_pennies, num_days): total_pennies - e 4 5 * Your…
A: def double_pennies(num_pennies, num_days): total_pennies = 0 total_pennies = num_pennies if…
Q: Input Th first line contains one integer t (1 < t < 1000) – the number of test cases. The only line…
A: In this Programming question we have to determine code and output of building with new layout…
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: = x+ x2/2+ x3/3+...... x^/n. Using do-while, write a program to compute f(x) for given x and n. The…
A: import java.util.Scanner;import java.lang.Math;public class Q3 {public static void main(String[]…
Q: Assuming the following code, what will the value of x be after the code is executed: x = 20 if x %…
A: SCREENSHOT OF CODE:-
Q: 3. Write a program that takes one argument, a positive integer n, and prints the product 1*2*..*n.…
A: Step 1: Check whether the number of command-line arguments not equals to 2. Step 2: If the condition…
Q: 2 i) int x = 1; int y //L1 %3D 2; 3; //L2 //L3 //L4 %3D int z y; %3D //L5 //L6 //L7 x + 5; = z;…
A: The explanation for the given program is given in step 2.
Q: Consider the following lines of code: int test1 = 83; int test2 = 90; double average = (test2 +…
A: The answer for this "No"
Q: S Q T S Q T (+) P QR S The problem asks to replace each letter with a number between 0 to 9 so that…
A: Given that, SQT (+) SQT = PQRS By adding 2 same three digit numbers, the value must be a…
Q: 300,400,500] L1=L[2:4] L1 print L2=L[1:5] L2 print
A: Code: L=[100,200,300,400,500] L1=L[2:4] print (L1) L2=L[1:5] print (L2) L2.extend (L1) print (L2)
Q: Given the following fragment of code: for(int i = 1; i< x; i++) temp = temp + i; %3D Generate a test…
A: WhiteBox Testing: This Testing basically Focuses on Internal Code structure and design. This…
Q: 2) Calculate y = x³ – 3x + 12 for x = [0, 1, 2, –3,–6, 200, –9] , print rules given below and y…
A: C++ Code for the given expression for all values of x #include <iostream> using namespace std;…
Q: Code fragment 1: int i=0; int scores[]={0,0,0}; 1 while(i<3) 2 { printf("Scores: "); scanf("%d",…
A: Ans : The true statements are : 1) Array declaration and Initialization 2) Relational Operator 3)…
Q: 1- Question We would like to create a pattern where in each line we will have 0, 4, 8, 12 stars;…
A: According to the Question below the Complete Solution:
Q: Write any six mutants for the following program. int maximum (int num1, int num2) { int maxima;…
A: Mutant: It is the code that contains minute changes. When the test data is run through the mutant,…
Q: A B C 1 2 3 T H E 4 5 6 17 8 lo IT E IS T 10 11 12 13 14 15 16 17 18 19 10 P R OG R AM Use the grid…
A: The table given:- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 10 A T H E T E S T P R…
Q: Question #1. Product in the Range [N...M] Write a Program that reads a starting number (N) and…
A: // C# program to print the product // of all numbers in range N and M using System; class GFG{…
Q: 4. What is the range of the random number generated from this equation: 2+ (int) (Math.random()* 99)…
A: Question 4: The Math.random() function is used for returning a pseudo random number which is of…
Q: Assuming the following code, what will the value of x be after the code is executed: x = 20 if x %…
A: Here initially x=20 if x % 2 == 0: As x is divisible by 2, x%2 = 20%2 return 0, thus this…
Q: Run this code and check if it works if not how would you fix it! n=int(input("Number of rounds of…
A: The given code has some loose ends. It's working but not effectively according to the game. The…
Q: 1: Volume.cpp) Write a program that reads a radius and prints the volume and surface area of the…
A: #include <iostream>using namespace std;int main() { float radius,volume,surface_area;…
Q: I want the code in C++. 7.10: Tic Tac Toe (sort of) Write a program that will allow two users…
A: the program is given below :-
Q: 2. Given the following pseudo code, write a program that executes it. а. read x b. read y с. compute…
A: Since programming language is not specified, we will be answering this question in python.
Q: Write a program that takes five students' quizzes in a course. Consider each student has given ten…
A: Best student will score highest average (sum of all quizes divided by the number of quizes) Worst…
Q: ) What will be displayed when the following code is executed? int number = 6; while (number > 0) {…
A: Code : public class MyClass { public static void main(String args[]) { int number = 6;…
Q: 1/ A Cuii number is the one whose digit sum is 17. Find out KthCuii number. K is an integer given as…
A: As per our company guidelines we are not supposed to answer more than one question per post and…
Q: The following code will print int n=2, m=3, *p; p=&m; p=&n; n=*p; printf("%d\n", n);
A: Here in the code, the concept of the pointer is used for printing the value of p. The Pointer in C…
Q: Int x,y,z ; X=y=z=0 X= ++y + ++z3; Cout<<x; X =y++ + z++; cout <<x;
A: According to the question below the output i am using endl in cout for next line Output:
Q: trace the following code and give the output. for (int p= -1; abs (p) < 12; p *= 2) if (abs…
A: Implementable Program code: #include <iostream> using namespace std; //main method int…
Q: 3.27 LAB: Mах of 3 Write a program that takes in three integers and outputs the largest value. Ex:…
A: Given: To write code in C.
Q: 4. Fix the errors and trace the output for the following program segment: int compute(int,int) void…
A: Given: Given a code with error, we need to correct and run it.
Q: To assign a value 1 to variable x, you write O a.x == 1; Ob.1:= x; Oc.1= x, Od x= 1; O ex = 1:
A: A variable is just a name given to a limit locale that our undertakings can handle. Each element in…
Q: Question) What should be the value of X in order that the following expression results false? vand…
A: Given expression: ~and(x,0.44~=4) || xor(x&4>24,4==44)…
Q: Given f(x) = x+ x2/2+ x/3+. x"/n. Using while do, write a program to compute f(x) for given x and n.…
A: Begin Enter the value of x Enter the value of n s<-0 i<-1 s<-s+xi/i i<-i+1 if (i <=…
Q: Write statements that assign random integers to the variable n in the following ranges: a) 1 ≤n ≤2…
A: Since the programming language is not specified, the following statements are in the C++ language. n…
Q: Given f(x) = x+ x2/2+ x3/3+.. x"/n. Using while do, write a program to compute f(x) for ...... given…
A: We can write its code in two different ways. Both the codes for this question are given below. Their…
Q: Q2. Write a program that reads the value of a positive integer n and prints the total number of…
A: Since the programming language is not mentioned so I have used the C++ programming language.…
Q: Given f(x) = x+ x2/2+ x³/3+.. x/n. Using while do, write a program to compute f(x) for given x and…
A: 1.import scanner class to get input from the user and import math for calculations 2.create a class…
Q: A B C 1 2 3 4 15 6 T H E T E S s b 10 11 12 13 14 15 16 17 18 19 10 T R 0 G RAM Given:name = Billage…
A: The following solutions are:
Q: Write statements that assign random integers to the variable n in the following ranges: a) 1 Sn S2…
A: Statements that assign random integers to the variable n in the given ranges: //(a) 1 ≤n ≤2 n = 1 +…
Q: a. Show how the code executes step-by step. Display (trace) the values of x and y as they change.…
A: Explanation: For the first option The variables x is declared as the 7, and y is declared as 3 In…
Q: 1. Write a program that displays the multiplication table for numbers o to 9. 2. Write nests of…
A: Program approach:- Using the header file. Define the main function. Declare integer type variable.…
Q: Given f(x) = x+ x2/2+ x³/3+... x^/n. Using while do, write a program to compute f(x) for given x and…
A: I have given an answer in step 2.
Q: Statistics are often calculated with varying amounts of input data. Write a program that takes any…
A: Program #displaying message to user to enter number print("enter inputs:") #taking data input from…
Q: Trace the following program. void main () { int n, m, x, y; m=10; n=m*2/(m+2); m%=n+2; printf("n:…
A: The answer is
Write a function to compute the following series:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- please code in python You place a pawn at the top left corner of an n-by-n chess board, labeled (0,0). For each move, you have a choice: move the pawn down a single space, or move the pawn down one space and right one space. That is, if the pawn is at position (i,j), you can move the pawn to (i+1,j) or (i+1, j+1). Ask the user for the size of a chessboard, n (integer). Find the number of different paths starting from (0,0) that the pawn could take to reach each position on the chess board. For example, there are two different paths the pawn can take to reach (2,1). Look at the diagrams below to convince yourself of this. You can see the four paths that you can take by move 2. Start -> Move 1 -> Move 2 (0,0) -> (1,0) -> (2,1) (0,0) -> (1,0) -> (2,0) (0,0) -> (1,1) -> (2,1) (0,0) -> (1,1) -> (2,2) Print the board with the number of ways to reach each square labeled as shown below. For example: Enter a board size: 4 1 0 0 0 1 1 0 0 1 2 1 0 1 3 3 1Write a code to find prime numbers between 100 and 200 Write a code which find power of number from 1 to n Example 2 raise to power 0 = 1 2 raise to power 1 = 2 2 raise to power 2 = 4 2 raise to power 3 = 8 2 raise to power 4 = 16 2 raise to power 5 = 32increasingDigits.py: Write a program to count all integers from 1 to n(inclusive) that have all digits in increasing order, where nis given as a command-line argument. For example, • 5 is in increasing order (single digit)• 237 is in increasing order (2 < 3 < 7)• 227 is not (2 !< 2)• 427 is not (4 !< 2) $ python3 increasingDigits.py 3024
- Java Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name.Find the errors in this code: double gpa[] = {2.2, 3.8, 4.0, 3.6, 1.7, 2.8}; int countSuper = 0; // number of students whose GPA >= 3.5 for (int count = 0; count < 6; count++){ if(gpa[count] >= 3.5){ System.out.print(”\n You are super!”); } countSuper++; } System.out.print(”\n Number of super students is: ”+ countSuper);What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x = x + y; } A) 90 B) 110 C) 210 D) This is an infinite loop.
- 1- Each Student Creates the F1 & F2 Equation With Their Own Number For example: Student Number: 249176126876 FI=2X^5+4X^4+9X^3+1X^2+7X^1+6X^0 F2 =1X^5+2X^4+6X^3+8X^2+7X^1+6X^0 For two equations: 1. Perform addition and the result (T) is variable. 2. Subtract and the result (C) is variable. 3. If: X = linspace (-5, 5, 100), plot the relationship between X and T. 4. Do the multiplication and the result (V) is a variable. 5. Divide and the result (A, B) is variable. 6. Introduce (T/F1) as a transfer function in MATLAB. 2- Program the desired operation using MATLAB commands for the given transfer function. write as: H1/H2=2X^5+9X^3+6/X^6+2X^4+8X^2+7X For X=linspace (1, 5, 10), if H1>H2, Draw the relationship between X and H1 or? Draw the relationship between X and H2 Note: Student number to be used in the solution; 207106106015 To be solved using the Matlap program3.19 LAB: Gross Pay Write a program to prompt the user for hours and rate per hour to compute gross_pay. A sample run would look like: Enter Hours: 35 Enter Rate: 16.75 Pay: $586.25 344614.2153518.qx3zqy7 LAB ACTIVITY 3.19.1: LAB: Gross PayHere is the assignment Write a program that prints the multiplication table but inserts a randomly generated incorrect value between 1 and 50 into a cell whose row and column are randomly selected. Make sure the program does insert an incorrect value. For example, if row and column of 3 and 4 are randomly selected, keep generating a random number to print for that location until it's not the right value of 12. Then, ask the user to tell where in the table the incorrect number is located by entering the row and column of the incorrect number. Print whether the user was right or not. If he or she was right, ask for and read the correct value; if not, the program must give the correct location and the correct number. My main issue: is how to set up the multiplication table? I've only learned the basics in C++ (loops and if statements).
- View the following code, and then answer how many times will this loop run? Enter the exact number of loops in the space provided (as a numeric, not spelt in words). int ammo = 12;void Start(){ while (ammo > 4) { Debug.Log("I have " + ammo + " ammo left."); ammo--; }} Ans:______The following code produces the following output: L=[100,200,300,400,500] L1=L[2:4] L1 print L2=L[1:5] L2 print .extend L2 (L1) L2 printWhat will be the final value of EAX in this example? mov eax, 0 mov ecx, 10 L1: mov eax, 3 mov ecx, 5 L2: add eax, 5 loop L2 loop L1 (ii) Write a program that calculates the following expression, using registers: A = (A + B) − (C + D) (iii) Write a program that uses a loop to copy all the elements from an unsigned Word array into an unsigned doubleword array. (iv) Write a program that displays a string in all possible combinations of foreground and background colors (16 x 16 =256). The colors are numbered from 0 to 15, so you can use a nested loop to generate all possible combinations. Also use a delay of 1s in each foreground color change.