Write a program that calculates y = -x².
Q: Write a program that generates two integers under 100 and prompts the user to enter the sum of these…
A: Explanation All that remains is to import the random library. randint() is a built-in function in…
Q: 2- What is the output of the expression (N(2,end)) where N=[2 4 5;1 2 4;7 8 0].
A: Here, Code is given.
Q: Write an expression that checks whether an integer is odd or eve
A: Actually, Take the remainder of dividing the number by 2 and check if it is 0 or 1 (respectively the…
Q: Homework: Write a program that calculates y = -x².
A: here is Your Code #include <stdio.h> int main(){ int x=2,y; y=-x*x; printf("y =…
Q: Using Python: Write a program which repeatedly reads numbers until the user enters “done”. Once…
A: The total will be used to give the sum of numbers entered, the count will give the number of values…
Q: 1: Volume.cpp) Write a program that reads a radius and prints the volume and surface area of the…
A: Input Radius Calculate Surface Area and display it Calculate Volume and display it
Q: Write a program that asks user to enter a number until user enters -1. Then the program should…
A: Since you have not mentioned programming language I'm doing this in c++.
Q: User Prompts Your program will allow a human user to play Rock, Paper, Scissors with the computer.…
A: #Program import random def main(): print('ROCK'+'PAPER'+''+'SCISSORS'+''+'in Python') print()…
Q: USE PYTHON A small shop sells 280 different items. Each item is identified by a 3 – digit code. All…
A: Maintain separate variables to store number of cards, sweets, stationery and toys
Q: Write a program that receives an ASCII code (an integer between 0 and 127) and displays its…
A: Given Write a program that receives an ASCII code (an integer between 0 and 127) and displays its…
Q: 1. Write a an algorithm that asks the user to input a positive integer n and counts how many of the…
A: The algorithm is a step-by-step program instruction in a human-readable format. The number of steps…
Q: Write a program that prompts the user to enter an integer anddisplays whether the integer is an odd…
A: Program code: //include the required packages #include <stdio.h> //define main function int…
Q: Write a program for pseudo- random where user input and obtain three different numbers.
A: Pseudo-Random Number- It is a number that is not really random, but seems to be random, i.e., each…
Q: Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of…
A: #include<iostream> using namespace std; int main(){ int number; cout << "Enter a…
Q: Write a program for calculating and printing the number set 4,4.5,5,5.5,6,.............9.5,
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: 10. Write a program that prompts the user to input any 10 integers. The program must print the sum…
A: C++ Code is in Step 2.
Q: Write a statement that assigns cell_count with cel_count multiplied by 10. * performs…
A: For given template code since we are printing cell_count, we need to assign value output value after…
Q: Write a program that prompts the user to enter an integer and prints the value of the following…
A: Below I have provided Java Programming. Also, I have attached the screenshot of the code and output…
Q: Write a program that converts "kilometers per hour" to "miles per hour". miles = (kilometers…
A: Hi. As there is no language mentioned, I will attempt this question using Python. Let's move on…
Q: 18. Write a program that allows the user to input two integers, one for the length of the rectangle…
A: Sol 18: The below given C++ program will obey the following rubrics: Including necessary header…
Q: 8- Write a program to calculate y from the equat ((3х — 7)}f (х %3D—5) y={(5x² )if (x= 2)or(x=5) |(x…
A: Define header file <iostream> for io operations. Define main function. Define int variable x.…
Q: Write a program that prompts the user to enter an integer between 0 and 15 and displays its…
A: #include<iostream>using namespace std;int main(){int decimalNum, rem, i=0;char…
Q: Write a program that prompts the user to enter a hex character and displays its corresponding…
A: NOTE: Since programming, langauge is not mentioned. Therefore answering the question in python…
Q: Write pseudocode for a program that outputs every number from 1 through 15 along with its value…
A: To do: Write Pseudocode
Q: 21. Input an integer and print its digits in reverse order. For example, if you input the integer…
A: // Import the scanner class import java.util.Scanner; public class Main { public static void…
Q: Q3:- / a: Write a Quick Basic program to compute S value where : S=1+ 1/3+1/5+1/7+ .1/n
A: Use a loop to start from 1 to n with increment of 2 . Set sum=0 Use formula sum=sum+ (1.0/i)…
Q: Write a program that accepts numbers from the user and counts the positive and negative numbers. The…
A: Below is the required code in C++ language. Program Approach: Including header files and using a…
Q: Write a program that converts pounds into kilograms. The program prompts the user to enter a number…
A: C++ Program: #include<iostream>using namespace std; // Function convertPtoK() to convert…
Q: Write a program that prompts the user to input five decimal numbers. The program should then add the…
A: Since, here no programming language is specified. So, we are providing a solution in C++. the below…
Q: Write a program that asks user to enter a number. Then the program should print the sum of all…
A: Given: Write a program that asks user to enter a number. Then the program should print the sum of…
Q: Write a program that prompts the user to enter two integers.
A: Since the programming language is not mentioned in the question, we will answer this question in C++…
Q: - Question: Write a program that accepts a set of integer numbers. Your program should count the…
A: 1) infinite loop to read data 2) loop breaks when input is -1 3) Read value is checked to find even…
Q: Write a program that reads an integer and uses a single variable to add 5 to the integer, multiply…
A: Given :- Write a program that reads an integer and uses a single variable to add 5 to the integer,…
Q: This code sorts the decimal places of a number consisting of ones, tens and hundreds, for example,…
A: Note, X Mod Y means, when you divide X by Y, what remainder you get X \ Y means, when you divide X…
Q: 8. Write a program that calculates and displays the area of a circle from its radius. The radius…
A: #include <iostream> using namespace std; int main(){ int radius; float area; cout…
Q: Write a program that will ask the user to enter 10 numbers and display the largest number entered.…
A: Note - As per our guidelines, we can provide solution only for one question. Since you have asked…
Q: Exercise: Write a program which asks the user to enter input for voltage, frequency and plot the…
A: Note: Answering in python as no language is mentioned. Input : Voltage Frequency Output : Plot of…
Q: 4- Write a python program that checks if the number entered by the user is a prime number. 5- Write…
A: ****As per our guidelines i answered 2 questions.Kindly repost other questions as a separate…
Q: Write a Little Computer Man program that determines if the number entered by a user is an odd or…
A: Process: A number is even if it is perfectly divisible by 2. When the number is divided by 2, we use…
Q: In Python create a program that reads two positive integers a and b from user and print the…
A: Given: In Python create a program that reads two positive integers a and b from user and print the…
Q: Create a software that calculates the sum of all the digits in a given number
A: The problem is based on the basics of loops in programming language.
Q: 1- Write a python code that asks the user to input the x and y coordinated of the points p1, p2 and…
A: As per our company guidelines we are supposed to answer only three sub part. Kindly repost other…
Q: Write a program that asks user to enter two numbers. Then the program should print the even numbers…
A: Task : Write a program to print even numbers between two numbers. C++ program :- #include…
Q: Write a program that takes in two integers as inputs and outputs the largest value.
A: Required: Write a program that takes in two integers as inputs and outputs the largest value.…
Q: The output of the code is: int main() { int x = 10; { int x = 0; printf("%d",x); } return 0;
A: first x=10 then 0 is overwritten in the variable x and then it becomes 0
Q: Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all…
A: Given: Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all…
Q: 1- Write a program to compute the value of y: 25 + 49 3 y = 1+++ Where 5
A: Since the language is not mentioned, I have done the first question using Python 3.
Q: 26.Temperature Conversion Write a program which prompts the user for a Fahrenheit temperature,…
A: note: since you have not mentioned your preferred programming language. I have attempted it in…
Q: This code sorts the decimal places of a number consisting of ones, tens and hundreds, for example,…
A: 1) We have a number 583 and we need to sort the decimal place of number consisting of ones tens and…
Write a program that calculates y = −x
2. 16bit
Step by step
Solved in 2 steps
- A prime number is called a Mersenne prime if it can be writtenin the form 2 p - 1 for some positive integer p. Write a program that finds allMersenne primes with p≤ 31 and displays the output as follows: p 2^p – 12 33 75 31...Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the smallest number and eyWrite a program that shows the numbers up to the entered number that are divisible by 6 but not divisible by 5.
- The formula to compute the area of a circle is Area = PI * radius^2so if a circle’s radius doubles (i.e., is multiplied by 2), the circle’s areawill be four times as large as before. Write a program that creates atable showing the radius and area for a circle whose radius beginswith 1 and continues doubling until it is 8. Use 3.14 for PI.Q1. FizzBuzz problem:- Write a program which return "fizz" if the number is a multiplier of 3, return "buzz" if its multiplier of 5 and return "fizzbuzz" if the number is divisible by both 3 and 5. If the number is not divisible by either 3 or 5 then it should just return the number itself? ."QUICK-BASIC64 Write an algorithm that finds and prints the sum of the first N terms of the series 1,4,7,10,... for a given integer N>0. (Please explain everything the program in details and please check whether the program runs or not by using q-basic64. Thank you so much)"
- 1. Write an algorithm that asks the user to enter ten numbers and then prints the largest one.2. Write an algorithm that asks the user to enter a positive integer n and prints the sum of the divisors of n.Write a guessing game program: - The program has to first generate a random number in range 1 - 100 inclusive.- The user has to enter a guess- The program has to either print lower or higher (if the user guess is less than the answer, it should print higher, otherwise lower)- The program should end and print 'You got it!' when the user gets it right. example: generated random number: 78 ````50```` example: generated random number: 78 ````50```` ````higher```` ````75```` ````higher```` ````87```` ````lower```` ````81```` ````lower```` ````78```` ````You got it!````Write pseudo code that will calculate a running sum. A user will enter numbers that will be added to the sum and when a negative number is encountered, stop adding numbers and write out the final result. (Please write a simple pseudo code for beginners, I mean easy to understand, thanks)
- Let n be a nonnegative integer. The factorial of n, written n!, is defined by 0!=1, n! =1*2*3*...n if n >= 1. For example, 4! = 1*2*3*4 = 24. Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of the number.Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all numbers from n1 to n2. For example, if the user enters n1=3 and n2=7, then the program should display the sum as 25.Convert feet into meters: Write a program which reads the number in feet, converts it tometers, and displays the result. One foot is 0.305 meters. One foot is 12 inches.Sample RunEnter the number of feet16.516.5 feet is 5.0325 meters16.5 feet is 198.0 inches