(2.)Write a program to draw this. Assume the innermost square is 20 units per side, and each successive square is 20 units bigger, per side, than the one inside it.
Q: program to calculate Y from the :equations
A: Program: // C++ Version 14#include <iostream>#include <cmath>using namespace std; //…
Q: ++ to program a Magic Eight Ball.
A: the c++ program is an given below :
Q: 3. Write a Python program to find the distance of an object by the parallax method, where the basis…
A: Write a Python program to find the distance of an object by the parallax method, where the basis and…
Q: 11. Determine whether each of these statements is true or false. a) x € {x} d) {x} € {{x}} e) ØC {x}…
A: x∈{x} This statement is true, because it represents an element x which belongs to the set.…
Q: Write a program to create the following figure
A: We are supposed to answer only single question at a time. I am going with the second question. I…
Q: 4. A ball rolls horizontally off a cliff at 10 m/s. It takes 20 seconds for it to hit the ground.…
A: The answer to the following question:-
Q: Write a program to find the roots of the following equation using Newton-Raphson: F(x) = exp (x) - 3…
A: define the F(x) value . also define it's derivate and pass the required parameters
Q: • provide a basic menu system to allow the user to: - Enter and store the data for a 3 x 3 matrix -…
A: I have provided code in step2
Q: B: Write a Program to compute the area of triangle with design.
A: Answer :-
Q: (B) The simplest experiment involve measuring a set of temperatures start from 20 to 30 at each…
A: ALGORITHM:- 1. Take input for the pressure at temperature set 0f 20. 2. Then increase the pressure…
Q: 2. Write a Python program to find the x coordinate of the center of mass of a uniform rod of length…
A: Required:- Write a python program to find the x coordinate of the center of mass of a uniform rod of…
Q: B: Write a program to print the following shape. Stat
A: A program to print the given shape in c language
Q: I need answer quickly Program takes the masses of two objects and the distance between them to…
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: Ex7: write ct+ program to solve the equation s=-7/x :
A: c++ program to solve the equation s=-7/x
Q: program to enter a value of x and compute the v
A: C program #include <stdio.h>#include <math.h>int main(){float X,Y;printf("Enter the…
Q: Compute the following, show all your steps: W⊕X⊕Y⊕Z
A:
Q: To write the contours of the surface at X,y,z we write the code :
A: According to the question we need to write the contours of the surface at x,y,z we write the code.
Q: -The graphic functions commonly used to create and print text are described. *
A: Given:
Q: Write a program to calculate the area between the curve and the X -axis for f(x) = sin(x) * cos(x)…
A: Find the python code below.
Q: Problem 4 Write a Python program that computes the volume of the sphere based on the diameter. The…
A: pi=22/7Diameter = float(input('Diameter of sphere: '))if Diameter<=0: print("Diameter can not…
Q: Program the problem Compute and print the state income tax. Net Income is Gross Income minus…
A: Note: Programming language not mentioned in the question. C++ is chosen as a programming…
Q: Use python and code Newton's Second Law (F=ma) as a function, evaluate it for some reasonable values…
A: Start Define a function "findForce" with two parameters return the function with the multiple of two…
Q: Use C++ to program a Magic Eight Ball.
A: code- #include <cstdlib>#include <string>#include <iostream>#include…
Q: 5- write simple program with use plot for this function x = 3a^2 + 4 cos(a)
A: Since range of values for a is not mentioned, I am assuming 0 to 2*pi Code:…
Q: 4. Write a program which will solve and print the results for the following equation: Ax2 + B = 0
A: - We have to solve the equation solving problem as the two problems given are not related.
Q: 2-Write a program to find the roots of the following equation using Newton raphson method: F(x) =…
A: Input to the Code : F(x) = exp(x) - 3x2 Output of the Code : Root of the above equation
Q: Example: Write a program to enter the value of two variables (X and Y). Find and print the Maximum…
A: Visual Basic is a very famous programming language these days, It is an Object oriented programming,…
Q: 4. Write a program to calculate a from the equation a=((5+x)/z)+(y/2.7*w).
A: As the values are not given form your side i am asking for these value form the user who is going to…
Q: Suppose x and y are int variables Consider the following staternents
A: Program: // Include header file #include <iostream> using namespace std; // Main function int…
Q: 9. write algorithm to find the result of the following equation: S-x, x<0 (x, x 20 f(x) =
A: Algorithm :- Start; Input x If( x<0) Return -x Else Return x. End Here first check…
Q: Computer Science Code the below in python or C: Given: n*m bar of chocolate and minimum number of…
A: def findMinimum(arr, n, k): res = 0 i = 0…
Q: Example 1: Write a program to find the area and perimeter of circle have known radius ( R ).
A: NOTE:-As per the guidelines I am solving the first question. Program Plan:- Ask the user to enter…
Q: write program to find the circumference of triangle square rectangular and circle using function
A: import mathdef square(): side = int(input("Enter the side side of the square : ")) perimeter =…
Q: 1. Given below a solid cone of height h and base radius r mounted over a solid hemisphere of radius…
A: Write a MATLAB program to take input the value of h and r from the user and print the volume of the…
Q: print to the screen the address of the variable x *
A: EXPLANATION: To print the address of a variable in C language, we should use the "%p" format…
Q: e) Find the moment of inertia of a hollow cylinder about the axis of the cylinder using a JAVA…
A: The solution to the given problem is below.
Q: QUESTION 7 What are the printed values for x when this code executes? int x = 6; %3D…
A:
Q: Set variables x, y, z, and function f, and g. In [ ]:
A: Given data is shown below:
Q: Write a program to generate the following pyramid
A: No programming language is specified so using c++. I have provided the code and output in step2.
Q: 22: Write a Cr+ Program to read (x) and Compute square and čube of X, then sumation of square and…
A: Start Input value of x Calculate sum Calculate cube Display sum, cube, summation Stop
Q: Q1) Write a Matlab program to read the value of (x) then compute and print the value of the…
A: Start Input value of x For 8 times, add term to w Print value of w Stop
Q: 12- Program to print hollow star pyramid in a diamond pattern
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: The output of the following program is to draw a group of stars in the form of
A: For the given code output with the details given below.
Q: 1. Consider a three-dimensional coordinate system in which a dart is projected at position (x0, Yo,…
A:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- C# Programming The Card Game One day, Fred and his N friends were playing a card game in which each player throws a card with a number written on it. The cards are such that a number X is written on front of the card, and the negative of that number is written on the back side of the card. This game has the following rules: - Each of the N players is asked to throw a card. After all the N cards are thrown, Fred has to flip one or more cards in consecutive order, only otice. Your task is to help Fred flip the cards in such a way that the sum of the numbers, on front face of the cards. is the maximum. Your Task is to return maximum sum the numbers, on the front cards. Input Output 13 -1 23 4 -5Key stroke enacted moving of a ball 1. Start (a) Write a Java program that uses the Up, ↑, Down ↓, Right → (and possibly Left) arrows of the keyboard (or keypad) to move a ball. (note the Up arrow is called “Up" with ASCII code 38, Down arrow is called "Down" with ASCII code 40, Right arrow is called "Right" with ASCII code. You can also use the 4 keys, commonly used in ODS game programming. Start Pond Figure 1. Initially Pond End End Start Pond Start Figure 2. After 3 moves up using up arrow End Pond End Figure 3. 3 moves later with right arrows Figure 4. Finally one at the lower right corner. (b) Using Java class JFrame to draw a grid of 5 horizontal lines, 5 vertical lines, a blue pond in the middle occupying 5 squares with a text Pond in the middle, a ball at the lower left corner, and texts called Start and End. This is shown exactly as in Figure 1 here. Change the color of ball from green to another color.1) BFS refresher: Suppose you have an n × n chessboard and a knight placed in one of the squares. Youwould like to find out the fewest number of moves needed to reach a given target square. Design an algorithmfor this task stated formally below: Input: An n × n chess board, a starting square S, and a target square T.Output: The fewest number of moves a knight takes to move from S to T. Write in Pseudocode, please.
- 4. Area of a Rectangle • Write a program that compares the area of two rectangles. You can do this several ways. one way is to add the length and width of each rectangle to get it's area and then compare the two areas together. • The program should ask for the length and width of two rectangles and then tell the user which rectangle has the greater area, or if the areas are the same. • The area of a rectangle is the rectangle's length times its width. Name the source code file yourName HW4.py. • Test and run the program. Capture the output console and save it as an image file named yourName HW4 output.jpg. • Submit the py and the image files through Canvas. Note: Sample output below: Fast l: Code-Tracing Output in comenta Vart 21 Days of the WeekBroken Cabins Problem Statement: There is an Office consisting of m cabins enumerated from 1 to m. Each cabin is 1 meter long. Sadly, some cabins are broken and need to be repaired. You have an infinitely long repair tape. You want to cut some pieces from the tape and use them to cover all of the broken cabins. To be precise, a piece of tape of integer length t placed at some positions will cover segments 5,5+1-sit-1. You are allowed to cover non-broken cabins, it is also possible that some pieces of tape will overlap. Time is money, so you want to cut at most k continuous pieces of tape to cover all the broken cabins. What is the minimum total length of these pieces? Input Format The first line contains three integers n,m and k(1sns10°, namsloº, Isksn) - the number of broken cabins, the length of the stick and the maximum number of pieces you can use The second line contains n integers bl,b2,bn (Isbism) - the positions of the broken cabins. These integers are given in increasing…Three numbersa. Write a program that reads three numbers and prints “all the same” if they are allthe same, “all different” if they are all different, and “neither” otherwise.b. Write a program that reads three numbers and prints “increasing” if they are inincreasing order, “decreasing” if they are in decreasing order, and “neither”otherwise. Here, “increasing” means “strictly increasing”, with each value largerthan its predecessor. The sequence 3 4 4 would not be considered increasing.c. Repeat part b. but before reading the numbers, ask the user whetherincreasing/decreasing should be “strict” or “lenient”. In lenient mode, thesequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing anddecreasing
- Leap Year: The earth doesn't take exactly 365 days to revolve around the sun and because of this we have leap years roughly every 4 years to make up the difference. The exact rule is: • Years divisible by 4 are leap years • except if they are also divisible by 100 and then they are not leap years (so 1900 was not a leap year), • unless they are also divisible by 400 and then they ARE leap years (so 2000 was a leap year). Part 1) Write a function in Python that takes as input a number, the year, and determines if it is a leap year or not. The function should return True if it is a leap year and False otherwise. Part 2) Write a main function to test out your leap year function on a few different illustrative inputs.Problem Descriptions: In this problem, your task is to write a program to find whether a user-entered 2-D point (P) lies (i) (ii) (iii) The circles are specified using their center coordinates and radii. See the illustrations below showing all three cases you need to consider: within both of the two given circles, within only one of those circles, or outside both circles (treat a point ON a circle as being inside the circle). Pis outside both circles Pis inside ONLY one circle Sample Outputs: Sample output #1 POINT MEMBERSHIP WITHIN TWO CIRCLES Circle 1: center at ( 6, -5 ) and radius: 3 Circle 2: center at ( 12, -7 ) and radius: 5 Please enter the x-coordinate of the test point: 8 -5 Please enter the y-coordinate of the test point: Point lies within both circles. Sample output #2 POINT MEMBERSHIP WITHIN TWO CIRCLES Circle 1: center at ( 6 , -5 ) and radius: 3 Circle 2: center at ( 12 , -7 ) and radius: 5 Please enter the x-coordinate of the test point: 12 Please enter the y-coordinate…The text presented the Sierpinski triangle fractal. Inthis exercise, you will write a program to display another fractal, called the Kochsnowflake, named after a famous Swedish mathematician. A Koch snowflake iscreated as follows:1. Begin with an equilateral triangle, which is considered to be the Koch fractalof order (or level) 0, as shown in Figure a.2. Divide each line in the shape into three equal line segments and draw an outwardequilateral triangle with the middle line segment as the base to create aKoch fractal of order 1, as shown in Figure b.3. Repeat Step 2 to create a Koch fractal of order 2, 3, . . . , and so on, as shownin Figures c and d.
- Problem Description: In the Whimsical Library, each book is enchanted with a magical code to ensure the protection of knowledge. The validation process for these magical codes involves a combination of mathematical spells. The validation process is described as follows: Take the sum of the digits at odd positions from left to right. Take the sum of the squared digits at even positions from left to right. If the absolute difference between the results from step 1 and step 2 is a prime number, the book code is considered valid; otherwise, it is invalid. Example 1: Consider the magical book code 86420137. Step 1. Take the sum of the digits at odd positions from left to right. 8+4+0+3=15 Step 2. Take the sum of the squared digits at even positions from left to right. 6^2+2^2+1^2+7^2=36+4+1+49 = 90 Step 3. If the absolute difference between the results from step 1 and step 2 is a prime number. 115-901 75 (not a prime number) Book code 86420137 is invalid. Example 2: Now, let's examine the…See the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Programmer's full name Project number Project due date Processing Requirements Use the following template to start your project: #include using namespace std; // Global constants // The number of rows in the array // The number of columns in the array // The value of the smallest number // The value of the largest number const int ROWS = 3; const int COLS = 3; const int MIN = 1; const int MAX = 9; // Function prototypes bool isMagicsquare(int arrayRow1[], int arrayRow2 [], int arrayRow3[], int size); bool checkRange (int arrayRow1[], int arrayRow2[], int arrayRow3[], int size, int min, int max); bool checkUnique(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size); bool checkRowSum (int arrayrow1[], int arrayrow2[], int arrayrow3[], int size); bool checkColiSum(int arrayrow1[], int…VPython 3500) assignments/3090165 Answers to ms to Canvas for the following problems. There should be 7 programs. 4B, 5, 6 1. A. Write a VPython program that creates eight spheres, each placed at one corner of a cube centered on the origin. The length of a side of the cube should be 6 units, and the radius of each sphere should be 0.5. Use at least two different colors for the spheres. B. Add to the program an arrow whose tail is at one corner of the cube and whose tip is at the corner diagonally opposite. The figure below shows the display from one possible solution to this problem. 2. Write a VPython program that represents the x, y, and z axes by three cylinders of different colors. This display from one possible solution is below.