Q4) Plot the curve* =r² , y = sin(t) – t cos t and z= Int for 2sts 67 . Use the "plot3" function. The color is green and the line width is 3. Label your axes. Once with the grid turned on and another time with the grid turned off.
Q: 2. write a program that enters and displays elements of x(10,10) and then displays the factorial of…
A: On this application to find Sum of Diagonal elements of a Matrix instance, We declared unmarried…
Q: FLEX & YACC hw Please add commentaries inside the code Make calculator also run with float…
A: FLEX and YAXCC to create a calculator
Q: 8. Write code to find the sum of even number between 1 to 30 numbers and print the result by using…
A: the answer is given below:-
Q: #include main() { int const a = 5; %3D a++; printf (%d,a); }
A: The const keyword is used to create constant variable in a program whose value cannot be changed…
Q: Q1/ Write a Program to compute the area of triangle with design.
A: Since programming language is not mentioned I have used the C++ programming language. Requirement:…
Q: R1 F1 F2 R2 The wheel shown is free to rotate around a fixed axis which passes from its central…
A: Here is the solution:-
Q: 06) write code to arrange the days and print the name of day and examine of the day is holiday or…
A: The question has been solved in step2
Q: Q1: One way to generate the value of Eulers number e is given by the formula e = lim (1+ )" Complete…
A: we need to provide python code for the given scenarios
Q: 3. The following program loads and displays an image. Complete the draw_border function to draw a…
A: 1) Image module 2) ImageOps module
Q: 19. The product of two m x n matrices is defined.
A: Given: Determine whether the statement are TRUE or FALSE. Write TRUE if the Statement is True and…
Q: - creates the following pattern of characters
A: Hello here is the code: #include <stdio.h> #include <conio.h> int main() { int i,…
Q: Create the following variables • a = 2.3; b = -87.3; • A = [1,2; 4,5]; Create a matrix 2 × 2 B using…
A: #include<iostream>#include<stdlib.h>using namespace std;int printRandoms(int lower, int…
Q: program to display the first and last colors from the given list. www
A: Required: program to display the first and last colors from the given list.
Q: 04. Write the following equation as a C++ expression and state the order of evaluation: -b + vb2 –…
A: The answer is given below.
Q: Create a program to calculate the hypotenuse of a triangle. Take the two sides i.e. base and…
A: Below is the required code in C++ language. Program Approach: Include necessary header files and…
Q: EX 3 using one print statment, print out "the answer to everything is 3" you must create the number…
A: Given that, We need to print "the answer to everything is 3" The number is must be result of adding…
Q: Q2: Write VB program (design a form and write a code) to change length form meters to feet, and then…
A: Algorithm: Start Read no.of meters m Calculate f=3.281*m Calculate inch=39.37*m Print f,inch Stop
Q: 11. Which mathematical expression from the below is represented by the fo in lovo 3
A: Question 11: The expression is given in java as '*' operator is being used.
Q: Q4) Write program, to allow the user to enter the height, and width of any rectangle, and find the…
A: I have answered the question in step 2.
Q: Form1 enter the value of x
A: VB.Net program to create the simple calculator :Module Module1 Sub Main() Dim choice As…
Q: Ask user to enter first name, last name,and city and then print the. each input could include the…
A: Since no programming language is mentioned, I am using python. As per the given question, we need to…
Q: BALLISTICS The range of an object (see Figure 5.12) shot at an angle 0 with respect to the waxis and…
A: % Defining the paramtersv = 20.0;g = 9.8; % Create vector thetatheta = linspace(0,pi./2,63);R =…
Q: Q9/ Draw the flow chart fo
A: Algorithm- Start Read the temperature if temperature is in celcius F= 9/5*(temperature+32) print F…
Q: Q2-Write a C++ code to print the below table by creating which has int value Age' moreover to two…
A: Given Question Write a C++ code to print the below table by creating which has int value "Age'…
Q: After every word on a line is spellchecked, it should be written to an output file called…
A: Solution: Note: I have implemented all the things. Please read the code carefully and if you have…
Q: Q1: A: Put (T) or (F) and correct the false for the following: A constant is a space in meniory…
A: As per guideline, I'm supposed to answer first 3 questions only. Re-post the other question as…
Q: 3. Show the Huffman Code for each character in the following string. “boss demigoddess ship”
A: We are given a string and we are asked the Huffman code for each character. First, we will check…
Q: complete the function that returns the area of a circle with radius r , note, use math.pi for pi.
A:
Q: 8. The dynamics of a comet is governed by the gravitational force between the comet and the Sun, f=…
A:
Q: They should type them in a line with spaces or commas between (specify which). Drop the lowest two…
A: Python used to answer this question
Q: Directions: Print the following shapes using def function. Provide the screenshot of codes and the…
A: I give the code in Python along with output and code screenshot
Q: b- Draw a flow chart to find Z from the equations: Z= VX+3e* Z= 3/X + SIN (X) .| x | -'א -מ (Using…
A: Input : Input X Output : Output Y
Q: Using only two lines, write the C++ code to print out the contents of the ideas array using a for…
A: Given Array string ideas[3]{"jalapeno Mustard", "Jalapeno IceCream", "Jalapeno Cake"}; To write c++…
Q: 1. Write program to check whether a number is Palindrome or not. [Hint]: A palindrome number is a…
A:
Q: Kilograms Pounds 1 2.2 6.6 11.0 7 15.4 9. 19.8 11 24.3 13 28.7 15 33.1 1) 1 kilogram is 2.20462…
A: Explanation for the given java code: In the class "Loopy", variable "x" is declared and initialized…
Q: If the lengths of the sides of a triangle are denoted by a, b, and c, then area of triangle is given…
A: The program is written in Java. Please find the program in step 2.
Q: Old-fashioned photographs from the nineteenth century are not quite black and white and not quite…
A: Answer: I have written a python code and as well as code screenshot.
Q: Q2. Write an algorithm and draw a flow chart to calculate the area of circles and calculate the area…
A: Algorithm Start Var aC,aR,tA, L,B,r Constant pi=3.1416 Accept length in L and breadth in B of…
Q: Q1:- Print program to find the area of rectangle that have 30 length and 20 width ?
A: I have written C programs to find the area of the rectangle. The C code is added on Step 2 and the…
Q: Q2: b- Write a program that uses a function to find and return the maximum number between N numbers.
A: sample output
Q: Input "Full Name" print first letter and last letter without array and loop and c programming
A: Algorithm:- scanf("%[^\n]%*c", str); use the above statement to input full name find the length…
Q: Q3- Write a program to find the circumference and the area of square its side x
A: Step 1: Prompt and accept the side of the square. Step 2: Find the circumference of the square by…
Q: Complete the following code: def calc(a, b): # This function returns the sum and the differer a =…
A: Here, in the above code we are receiving the values in two variables s and d for the sum and…
Q: When measuring angles values less than 0 or greater than 360 can be converted into the range…
A: Code: x <- c(45,345,600,23,705)k<-0for (value in x) {k<-k+1 if(value>360){…
Q: Q4: Complete the following code by filling the blanks: ________ velocity(double distance, double…
A: In the above-given question, it has been asked to write down the function that is partially written…
Q: Assume that a, b, c, and d are as defined, and evaluate the expressions: (a > b && c > d) and (-b).…
A: Given:
Q: 3. Write a JavaScript function to calculate the circumference of the circle, note that pi=3.14 and…
A: Actually, JavaScript is a programming language for the web.
Q: After following statements have executed, find the value of the variable a. int a=15; while (a>0)…
A: Answer: 0 Explanation: While loop: It is an entry control loop that checks the condition while…
Step by step
Solved in 2 steps with 4 images
- Write the following function to draw a regular polygon:def drawPolygon(x = 0, y = 0, radius = 50, numberOfSides = 3):The polygon is centered at (x, y) with a specified radius for the bounding circle for the polygon and the number of sides. Write a test program that displays a triangle, square, pentagon, hexagon, heptagon, and octagon, as shown in Figure 6.12a.1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.1. Examine the following code segment. What will be printed?If there are any errors indicate the nature of each error.int a[7] = { 31, 12, 32, 14, 25, 16, 27 };int *ptr ;ptr = & a[ 2 ] ;for( i = 1; i <= 5; i = i + 2)cout << *( ptr + i ) ;cout << a[0] << *ptr << *ptr - 2 << *(ptr - 1)) << endl;
- “Days Into Year (C++)” By using my code (photo is attached), implement a Days Into Year function. It MUST BE of this form: int daysIntoYear ( int year, int month, int day ) ; In terms of "Days Into Year," how many days are we into the year based on a given date? For example, January 1 is 1 day into the year. Please have the code display 12 test cases with the result from the function, and the number of days into the year from some other source. So you can hand calculate the days into the year or use an internet web page. The typical output might look like this: (Please make the format better but be sure to automatically calculate agree/disagree column) You must include a leap year function that returns a bool and takes as a parameter the year. This function must be used in your code. Year Month day Days Into Year Value expected Agree/Disagree 2020 1 1 1 1 agree 2020 1…python code Problem 5 A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams x 9. Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs = carb grams x 4 . Write a program that will make these calculations. Your program should use two separate functions to calculate fat and carb calories. Write a 3rd function that is called from main to capture user input and call the others.1. Examine the following code segment. What will be printed?If there are any errors indicate the nature of the error. int a[8] ={16, 12, 10, 7, 15, 18, 17, 29}; int *ptr ; ptr = & a[ 5 ] ; for(int i = 0; i<= 4; i = i + 2) cout<<a[i]<<*( ptr + i )<<endl; cout<<” ”<<a[1]<<” ”<<*ptr<<” ”<<*ptr + 2<<” ”<<*(ptr + 3);
- Use R studio Let Xt be the grid (matrix). Xt(i, j) = 0, 1, 2 Write a function in R that takes a grid X and the point(i, j) and computes the number of 1.C Programming Write function checkHorizontal to count how many discs of the opposing player would be flipped, it should do the following a. Return type integer b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. char playerCharc. If the square to the left or right is a space, stop checking d. If the square to the left or right is the same character as the player’s character, save that it was a flank, stop checking e. If the square to the left or right is not the same character as the player’s character, count the disc f. If the counted discs is greater than zero AND the player found their own character, return the counted discs, otherwise return ZERO Write function checkVertical to count how many discs of the opposing player would be flipped, it should do the following a. Return type integer b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. char playerCharc. If the square above or below is a space, stop checking d. If the square above or below is…def pay(hours, pay_rate): pay = hours * pay_rate print(f'pay is ${pay:.2f}') Identify the statements that correctly call the pay function. Select ALL that apply. print(pay(40,15.00) pay(40,15.00) week_pay = pay(40,15.00) hrs = 32rate = 18.50print(pay(hours,pay_rate) )
- 2. Write code that uses turtle graphics to draw four concentric circles ofradius 50, 100, 150 and 200.Complete this code using python language #Write the conditions to check if anyone has won the game. This function will be called from the placeCharacter function. # r : In which row the current character was placed# c : In which column the current character was placed#returned value: True if anyone has won;Otherwise Flasedef checkBoard(r,c):#Write your code here #Write the necessary code to put the "char" in proper position of the board and check if anyone has won.#pos : The position that has been given by the player as input.#char : The character representing the player. It can be X or O.#count: It represents the number of turns. It can be from 0 to 8.#returned value: True if anyone has won;Otherwise Flasedef placeCharacter(pos,char,count):#Write your code heredef gameInitialization():global player1,player2player1 = input("Enter player 1's name:")player2 = input("Enter player 2's name:")print(f"{player1}, your character is X")print(f"{player2}, your character is O")def…(C++) A robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move randomly in any of the directions: up, down, left, right. For each move, print the direction of the move and the current position of the robot. If the robot makes a circle, which means it moves back to the original place, print “Back to the origin!” to the console and stop the program. If it reaches the boundary of the grid, print “Hit the boundary!” to the console and stop the program. A successful run of your code may look like: Down (0,-1) Down (0,-2) Up (0,-1) Left (-1,-1) Left (-2,-1) Up (-2,0) Left (-3,0) Left (-4,0) Left (-5,0) Hit the boundary! or Left (-1,0) Down (-1,-1) Right (0,-1) Up (0,0) Back to the origin!