Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print their square. For example 1. Squared = 1 2. Squared = 4 3. Squared = 9 4. Squared = 16 5. Squared = 25 Ref Range Looping slides (Part 2 Lecture 8, Range Looping)
Q: A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a…
A: Since programming language not mentioned, using C++
Q: Programming Problem 1. Rock, Paper, Scissors This is your traditional rock-paper-scissors game,…
A: Lets see the solution in the next steps
Q: Q2- You have two figures a rectangle and a circle, the circle inside the rectangle. Compute and…
A: Start Input length of rectangle Input width of rectangle Input radius of circle Calculate area of…
Q: A triangle is considered valid if the sum of each 2 sides is greater than the remaining third side.…
A: We have to write a program a program that takes the length of three sides and print "equilateral",…
Q: HOMEWORKS 1- Write a program using the function to calculate the distance between two points in the…
A: To find distance between two points , formula used. sqrt(y2-y2)2 +(x2-x1)2 To find slope you can…
Q: (Prism Program) Write a program that can calculate the value of the surface area and volume of a…
A: As Programming language is not mentioned, taking C as reference. Inputs : Lenght, Width and Height…
Q: **3.19 (Geometry: point in a circle?) Write a program that prompts the user to enter a point (x, y)…
A: Step-1: StartStep-2: Declare variable x, y, distanceStep-3: Calculate distance by using square root…
Q: C++ One way to create a pseudo-random three digit number (and we are including one- and two-digit…
A: Code: #include <iostream>#include <cstdlib>#include <ctime>using namespace std;…
Q: Write a program which reads two integer values. If the first is less than the second, print the…
A: Here I have declared 2 variables num1 and num2 of integer data type. Next, I have taken input from…
Q: Computers are playing an increasing role in education. Write a program that will help an…
A: code into HTML:
Q: (Display balls with random colors) Write a program that displays ten balls with random colors and…
A: Given: Write a program that displays ten balls with random colors and placed at random locations
Q: Python with Turtle Write a program that will have Turtle draw a hexagon. • You should: 1. Have…
A: # import the turtle modules import turtle # Start a work Screen ws = turtle.Screen() # Define a…
Q: Homework-4 Write a program read x value then compute S value from the following series: 1 (X – 1y +…
A: Note: Answering in python as no language is specified. Input to the Program : Four different values…
Q: palindromic prime is a prime number and also palindromic.For example, 131 is a prime and also a…
A: Program: //Definition for class "Main" public class Main { //Definition for main class public…
Q: Square of 13 is 169. 31, which is a reverse of 13 has a square 961. Here are few numbers which have…
A: // Following C Program will give required Output #include <stdio.h>int reverse(int n){…
Q: (Comparing Integers) Write a program that prompts the user to enter the edges of a triangle and…
A: PROGRAM CODE: #include<iostream>using namespace std;int main(){ int side1, side2, side3; cout…
Q: Python Coding (on PyCharm Community Edition) WHAT COLOUR SQUARE PART 1 - Positions on a chess board…
A: The approach and code of a python program to check whether the position of the square of a…
Q: Sometimes a company will use telephone numbers like 757-GET-FOOD to make the numbers easier to…
A: A = B = C = 2D = E = F = 3G = H = I = 4 J = K = L = 5 M = N = O = 6 P = Q = R = S = 7 T = U = V = 8…
Q: **3.23 (Geometry: point in a rectangle?) Write a program that prompts the user to enter a point (x,…
A: C++ Program for above : #include <iostream> using namespace std; int main() { int…
Q: Write a program that shows ten unique random words, all over ten characters long, that occur in the…
A: Below i have answered:
Q: Exercise 4 – Repeatedly Echo a Word Write a program that asks the user to enter a word. The program…
A: 1. Declare the variables- inputString and times 2. Take in input from the user in the variable-…
Q: The volume of a cylinder can be computed by multiplying the area of its circular base by its height.…
A: The answer for the above mentioned question is given below in step 2.
Q: (Convert feet into meters) Write a program that reads a number in feet, converts it to meters, and…
A: Lets see the solution.
Q: Area and Perimeter: Write a program that prints the area and perimeter of a circle with a radius of…
A: Solution: Approach: Create a class circle In the main method declare the variables radius, area,…
Q: (Geometry: area of a hexagon) The area of a hexagon can be computed using the following formula (s…
A: Code: // HexagonValue.cc// Program to calculate the area of a regular hexagon inscribed in a//…
Q: The Fibonacci series is a series that begins with 0 and 1 and has the property that each succeeding…
A: PROGRAM CODE: #include <iostream> // include header file for input output stream…
Q: (Sum the digits in an integer) Write a program that reads an integer between 0 and 1000 and adds all…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args)…
Q: Q29) Consider you have a list of 20 exam scores. Write a computer program that calculates the…
A: #Code in MATLAB: clear; a=[73, 91, 37, 81, 63, 66, 50, 90, 75, 43, 88, 80, 79, 69, 26, 82, 89, 99,…
Q: Exercise 2: Write a program that calculates the cost per square inch of a circular pizza, given its…
A: import java.util.*;import java.text.*;public class Main { public static void main(String[] args) {…
Q: Area and Perimeter: Write a program that prints the area and perimeter of a circle with a radius of…
A: logic:- set radius=5.5 use formula, perimeter=2*radius*math.pi area=radius*radius*math.pi display…
Q: Write a program in which the Nibble Monster keeps asking for nibbles until the user enters 'Q' or…
A: NOTE : Since programming language is not mentioned. Therefore answering question in python language.…
Q: What is the range of values that x can hold after this statement is executed? double x =…
A: Answer:A perform is increasing within the same vary wherever it's spinoff is positive. Now, notice…
Q: 4.33 - (Perfect number) A positive integer is called a perfect number if it is equal to the sum of…
A: A perfect number is the sum of all the divisors less than n is equal to the n value then n is called…
Q: ecks whether the point is within the circle centered at (0, 0) with radius 10. For example, (4, 5)…
A: Given:
Q: Suppose a right triangle is placed in a plane as shown below. The right-angle point is at (0, 0),…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: IN PYTHON ONLY: Write a program that uses radio buttons to select background colors for text, as…
A: #Python Radiobutton using Application
Q: Find the first 10 square numbers that are greater than Long.MAX_VALUE. A square number is a number…
A: Program: import java.math.BigInteger; public class Main { public static void main(String[] args) {…
Q: (Area and perimeter of a rectangle) Write a program that displays the area and perimeterof a…
A: Objective: This program would display the area and perimeter of a rectangle whose width would be 5.3…
Q: (Racing car) Write a program that simulates car racing, as shown in Figure 9.29b– d. The car moves…
A: Solution:-- 1)To draw a fan and a moving car. 2)The above requirements are drawn using python code.…
Q: (Area and perimeter of a rectangle) Write a program that displays the area and perimeter of a…
A: Algorithm: The algorithm to find the area and perimeter of the rectangle is: Start w=4.5 h=7.9…
Q: Geometry: distance of two points) Write a program that prompts the user to enter two points (x1,…
A: C++, programming language can be used to perform the task efficiently. It is a multi purpose, multi…
Q: Question 2: Write a program to check responses of a student to the multiple-choice final exam. The…
A: C++ used to answer this question
Q: 4. Write a simple program that checks the coordinates of a point taken from a user and identifies…
A: code: //include the required headers #include<iostream> using namespace std; //main method…
Q: Q4 : Write Program in Visual Basic to Find the Result of the equation W = + y-(z-y I# x=2 y = 3 Z= 5
A: We need to write a Visual Basic program to find the result of the given expression. The given…
Q: // This program gets student names continuously until XXX is entered. Then, for each student, quiz…
A: All the return boxes should be connected under one box.
Q: **3.22 (Geometry: point in a circle?) Write a program that prompts the user to enter a point ( x, y…
A: The given problem is to find the position of a point in x,y cordinate on x-y axis and find whether…
Q: 6. A palindrome is a number or text phrase that reads the same backwards or forwards. For example,…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: Write a program that prompts the user to enter the edges of a triangle and compares them. If all…
A: In the solution of given problem, we need to use Else-If ladder statement to test the conditions. An…
Q: (Display a pattern) Write a program that displays the following pattern:JJ aaa v vaaaJ J aa v v a aJ…
A: File name: "Solution.java" public class Solution { public static void main(String[] args)…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Q: Write a program which reads two integer values. If the first is less than the second, print the message up. If the second is less than the first, print the message down If the numbers are equal, print the message equal. (Visual Basic)A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a palindromic prime, as are 313 and 757. Write a program that displays the first 120 palindromic prime numbers. Display 10 numbers per line, separated by exactly one space, as follows: 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929(Display Magic Numbers) Display the first N magic numbers, where N is a positive number that the user provides as input. Here, a magic number is a number whose sum of its digits eventually leads to 1. For example, 1234 is a magic number because 1 + 2 + 3 + 4 = 10 and 1 + 0 = 1, while 1235 is not (1 + 2 + 3 + 5 = 11 and 1 + 1 = 2). Write a program that prints out the first N magic numbers, seven on each line. Here is the sample output: You are required to use the following function prototype: bool isMagic(int value); // Returns true if value is a magic number The outline of this function will be as follows: Step 1: Calculate the sum of digits of value Step 2: Repeat Step 1 until we get a single digit Step 3: If the resulting sum is equal to 1 then it is a magic number, otherwise not
- One interesting application of computers is drawing graphs and bar charts.Write a program that prompts the user to enter 5 integers, and then outputs abar chart consisting of asterisks. The number of asterisks in each line of thebar chart must be equal to the number the user entered. You may assume theuser will enter only positive integers or 0. C++ please.. Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion: A, B and C = 2 D, E and F = 3 G, H and I = 4 J, K and L = 5 M, N and O = 6 P, Q, R and S = 7 T, U and V = 8 W, X, Y and Z = 9 Write a program that asks the user to enter a 10-character number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD, the application should display 555-438-3663. After displaying the translated telephone number, ask the user if they’d like to enter another number. If the user enters “y”, run the program again. If not, terminate the program. (10 points)Note: the sentence the program reads SHOULD NOT be hardcoded. Allow the user to enter the sentence the program reads PYTHONComputers are playing an increasing role in education. Write a program that will help an elementary-school student learn multiplication. Use Math.random to produce two positive one-digit integers. It should then display a question such as How much is 6 times 7? The student then types the answer into a text field. Your program checks the student’s answer. If it’s correct, display the string "Very good!" and generate a new question. If the answer is wrong, dis- play the string "No. Please try again." and let the student try the same question again repeatedly until he or she finally gets it right. A separate function should be used to generate each new ques- tion. This function should be called once when the script begins execution and each time the user answers the question correctly.
- C++ coding In order to paint a wall that has a number of windows, we want to know its area. Each window has a size of 2 ft by 3 ft. Write a program that reads the width and height of the wall and the number of windows, using the prompts Wall width: Wall height: Number of windows: Then print the area with two digits after the decimal point: Area: ...Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and integer as input, and outputs a sentence using those items as below. The program repeats until the input string is quit. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away. Note: This is a lab from a previous chapter that now requires the use of a loop. My code user_input = input()while True: item = user_input.split()[0]item_count = int(user_input.split()[1])if item.lower() == "quit":break print("Eating " + str(item_count) + " " + item + " a day keeps the doctor away.")(Geometry: point in a circle?) Write a program that prompts the user to enter apoint (x, y) and checks whether the point is within the circle centered at (0, 0) withradius 10. For example, (4, 5) is inside the circle and (9, 9) is outside the circle, asshown in Figure 3.7a.(Hint: A point is in the circle if its distance to (0, 0) is less than or equal to 10.The formula for computing the distance is 2(x2 - x1)2 + (y2 - y1)2. Test yourprogram to cover all cases.) Two sample runs are shown below: Enter a point with two coordinates: 4 5Point (4.0, 5.0) is in the circleEnter a point with two coordinates: 9 9Point (9.0, 9.0) is not in the circle
- One interesting application of computers is drawing graphs and bar charts (sometimes called histograms). Write a script that reads five numbers between 1 and 30. For each number read, output HTML5 text that displays a line containing the same number of adjacent asterisks. For ex- ample, if your program reads the number 7, it should output HTML5 text that displays *******.(Comparing Integers) Write a program that prompts the user to enter the edges of a triangle and compares them. If all edges are equal, display Equilateral Triangle; if only two edges are equal, display Isosceles Triangle and if none of the edges are equal, display Scalene Triangle. Use c++ program.Find the first 10 square numbers that are greater than Long.MAX_VALUE. A square number is a number in the form of n2. For example, 4, 9,and 16 are square numbers. Find an efficient approach to run your program fast.