1.
print("a\ta^2\t^a^3\ta^4")
for i in range(1,5):
print(i,"\t",i*i,"\t",i*i*i,"\t",i*i*i*i)
2.
print("approximate value of pie using 4*(1-1/3+1/5-1/7+1/9-1/11) is : ", 4*(1-1/3+1/5-1/7+1/9-1/11) )
print("approximate value of pie using 4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15) is : ", 4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15) )
3. Here, it is asked to return reverse order but in example it is shown in the normal order , but I have done coding for both reverse order and normal order
number = int(input("Enter a 6 digit number : "))
new_number = 0
print("numbers in reverse order")
while(number>0):
remainder = number%10
number = number//10
print(remainder)
new_number = new_number*10+remainder
print("numbers in original order")
while(new_number>0):
remainder = new_number%10
new_number = new_number//10
print(remainder)
4.
character = input("Enter a character")
print("UniCode Code for given character is : ",ord(character))
5.
import turtle
import math
skk = turtle.Turtle()
print(turtle.position())
for i in range(4):
skk.pencolor("red")
skk.forward(5)
skk.right(90)
skk.forward(5)
skk.right(90)
skk.forward(5)
skk.right(90)
skk.forward(5)
skk.right(90)
skk.pencolor("black")
skk.forward(100)
skk.right(90)
# for i in range()
skk.setpos(0,-50)
skk.right(90)
skk.pencolor("blue")
skk.circle(50)
skk.left(90)
skk.forward(100)
skk.pencolor("black")
skk.left(90)
skk.forward(50)
skk.left(135)
j = 0
while (j<35):
if(j%2 == 0):
skk.penup()
skk.forward(4)
else :
skk.pendown()
skk.forward(4)
j = j+1
turtle.done()
6.
import turtle
import math
skk = turtle.Turtle()
for i in range(4):
skk.forward(200)
skk.right(90)
skk.penup()
skk.forward(5)
skk.right(90)
skk.forward(5)
skk.left(90)
skk.pendown()
skk.pencolor("blue")
for i in range(4):
skk.forward(80)
skk.right(90)
skk.penup()
skk.forward(110)
skk.pendown()
skk.pencolor("green")
for i in range(4):
skk.forward(80)
skk.right(90)
skk.penup()
skk.right(90)
skk.forward(110)
skk.pendown()
skk.pencolor("yellow")
skk.left(90)
for i in range(4):
skk.forward(80)
skk.right(90)
skk.penup()
skk.right(180)
skk.forward(110)
skk.pendown()
skk.pencolor("red")
skk.left(180)
for i in range(4):
skk.forward(80)
skk.right(90)
skk.penup()
skk.forward(15)
skk.right(90)
skk.forward(60)
skk.pendown()
skk.fillcolor('red')
skk.begin_fill()
skk.left(90)
skk.forward(50)
skk.left(120)
skk.forward(50)
skk.left(120)
skk.forward(50)
skk.end_fill()
skk.penup()
skk.left(120)
skk.forward(105)
skk.pendown()
skk.pencolor('yellow')
skk.fillcolor('yellow')
skk.begin_fill()
skk.forward(60)
skk.left(90)
skk.forward(40)
skk.left(90)
skk.forward(60)
skk.left(90)
skk.forward(40)
skk.left(180)
skk.end_fill()
skk.penup()
skk.forward(130)
skk.right(90)
skk.forward(5)
skk.pendown()
skk.pencolor('green')
skk.fillcolor('green')
skk.begin_fill()
skk.right(90)
skk.circle(25)
skk.right(90)
skk.end_fill()
skk.penup()
skk.forward(55)
skk.left(90)
skk.forward(30)
skk.pendown()
skk.pencolor('blue')
skk.right(90)
skk.fillcolor('blue')
skk.begin_fill()
for i in range(4):
skk.forward(60)
skk.right(90)
skk.end_fill()
Just a request , Please don`t so much questions at one go , It`s
difficult to answer all of them in just 2-3 hrs span . Better break
half quantity and ask , it would help us also .
Hope the answers help, If any issue do comment !!
USING PYTHON LANGUAGE. QUESTION I: Write a program that displays the following table: a a^2 a...
write a java program that displays the following: Write a Java program that prompts the user to enter an integer and determines whether 1. it is divisible by 5 and 6, whether on 2. it is divisible by 5 or 6, 3. it is divisible by 5 or 6, but not both. Here is a sample run of this program: Sample run: Enter an integer: 10 Is 10 divisible by 5 and 6? false Is 10 divisible by 5 or...
Q: 4.9 (Find the Unicode of a character) Write a program that receives a character and displays is Unicode. Here is a saple run: Enter a character: E < Enter The Unicode for the character E is 69. Interdaction to Java Programming, Brief Version. 10th Edition.
Write a program that receives a character and displays its Unicode. using java please
Problem 1: Write a program that reads a positive float number and displays the previous and next integers. Sample Run: Enter a float: 3.5 The previous and next integers are 3 and 4. Problem 2: Write a program that reads two integers and displays their sum, difference, product, and the result of their division. Sample Run: Enter two integers: 8 5 Sum: 8, Difference: 3, Product: 40, Division: 1.6 Problem 3: Write a program that reads a three-digit integer from...
Write a program that prompts the user to enter a file name and displays the occurrences of each letter in the file. Letters are case-insensitive. Here is a sample run: Enter a filename: Lincoln.txt Number of A’s: 23 Number of B’s: 0 Number of C’s: 12 …… Number of Y’s: 5 Number of Z’s: 7
Write a program that prompts the user to enter a binary string and displays the corresponding decimal integer value. For example, binary string ‘10001’ is 17 (1*24 +0*23 +0*22 +0*2 + 1 = 17) A sample run : Enter a binary: 10001 17 Enter second integer: 110 6 Use python.
PYTHON: (Sum the digits in an integer using recursion) Write a recursive function that computes the sum of the digits in an integer. Use the following function header: def sumDigits(n): For example, sumDigits(234) returns 9. Write a test program that prompts the user to enter an integer and displays the sum of its digits. Sample Run Enter an integer: 231498 The sum of digits in 231498 is 27
please write psedocodes for all of the questions and an algorithm for 2. no coding is required . FIUJELI 95 PIOL 1. (Geometry: Area of a Pentagon) Write a C# program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing the area of a pentagon is Area = 2 , where s is the length...
in c++ language 1.Re-write the following for loop statement by using a while loop statement: int sum = 0; for(int i=0;i<=1000;i++){ sum+=i; } 1 (b). Following is the main () function of a program. The program asks a user to enter 150 integers and print the largest integer user entered. int main() { int score, highest; //missing portion of the program return 0; } 1(c). Find the missing portion of the following code, so the...
write a python program that allows the user to enter two integer values, and displays the results when each of the following arithmetic operators are applied