Write a program that prompts the user to enter a positive integer and obtains its square root in simplest form. For example, the simplest form for is 3 is, for is 2, and for 3is 18. Here are some sample runs: Enter a positive integer: 1300 sqrt (1300) is 10*sqrt (13) <Еnd Outpu> Enter a positive integer: 31 sqrt (31) is sqrt (31) Еnd Outpu> Enter a positive integer: 64 sqrt (64) is 8 <Еnd Outpu
Q: Write a program that asks the user for a number and writes its decomposition into prime factors: The…
A: The given is a programming assignment where the program is to be written in C++. The user will be…
Q: Write a python program: Let the user specify S (the number of sides on a die) and N (the number…
A: Import the random library and prompt the user for the values of N and S. Use a for loop for N times…
Q: Write a program that reads the height h and radius r of Right Circular Cone and finds the surface…
A: As no programming language is mentioned, I am using python. In step 2, you will get the python code.…
Q: Write a program that reads a floating point number and prints "zero" if the number is zero.…
A: """Program will read a floating-point number and print "zero"if the number is zero.Otherwise, print…
Q: Write a program that reads from the user two integers of three digits each. The program finds the…
A: import java.util.*;public class Main{ // to display the digits of number separated by space public…
Q: Write a program that accepts a number of minutes and converts it both to hours and days. For…
A: As no programming language is mentioned it is solved using basic C++
Q: Write a program that prompts the user to input an integer (not a String) and then outputs both the…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as…
A: EXPLANATION - Create a program . In main function declare three variables that are p , q , r .…
Q: Write a program that asks a user to input non-negative integers (numbers that are >=0) until the…
A: In the following steps, the input, output and the code screenshot along with the output has been…
Q: Write a program that finds five prime numbers largerthan Long.MAX_VALUE.
A: Program: //import math package for mathematical operations import java.math.*; public class Main {…
Q: Write a program that lets the user enter the coordinates of the center and radius of two circles,…
A: Answer: C++ Source Code: #include <iostream>#include <cmath> using namespace std; int…
Q: Write a program that accepts a number as input and checks if the difference between the sum of…
A: According to the information given:- We have to follow the instruction and write program that…
Q: Write a program that inputs a natural number n from the keyboard, computes the cube sum of first n…
A: Here we would need to use a loop that runs from 1 to n where n is input from user.
Q: Write a program that accepts a number corresponding to a plane figure: 1. Right Triangle 2.…
A: import math choice = int(input("1. Right Triangle \n2. Rectangle \n3. Circle\n")) if choice == 1:…
Q: Write a program that reads 11 integers, compares eachinteger with the 11th integer, and displays…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Write a program that asks the user to enter 2 integers of 4 digits and displays the different digits…
A: Program Explanation: Declare the header files Declare and define the function to compare two…
Q: Write a program that reads an unspecified number of integers and finds the ones that have the most…
A: GIVEN: Write a program that reads an unspecified number of integers and finds the ones that have the…
Q: Write a program that reads an integer between0 and 1000 and multiplies all the digits in the…
A: Since, programming language is not mentioned in the question, we will answer this question in Java…
Q: A Fibonacci sequence is a sequence of numbers where each successivenumber is the sum of the previous…
A: We need to find the nth Fibonacci number where the n is the value given by user
Q: Write a program that plays a number guessing game with a Human user. The Human user will think of a…
A: // do comment if any problem arises //code #include <iostream> using namespace std; //this…
Q: Write a program that prompts the user to enter threepoints, (x1, y1), (x2, y2), and (x3, y3), of a…
A: Given: Three vertices of a triangle will be provided by the user. Objective: The area of the…
Q: Write a program that reads two integers, a and b, from the user. Where a is equal to 17 and b is…
A: Note: Below is the required program in the python language. Program Approach: Ask the user to enter…
Q: Write a program that implements a tip calculator. Your program should ask the user for the bill…
A: Here no language is mentioned, so i have provided python code for given question.
Q: In Python, Write a program whose input is two integers. Output the first integer and subsequent…
A: #get the input from the user num1=int(input()) num2=int(input()) #check if num1 is greater than…
Q: Write a program that splits a 4-digits integer number into thousands, hundreds, tens, and ones. For…
A: Note: Answering the question in python as no language is specified. Input : Input the number.…
Q: Write a program that reads the width, height and a character from the user, then calculates the…
A: Code import java.util.Scanner;public class Main{ public static void main(String[] args) {…
Q: Write a program that inputs one five-digit number, separates the number into its individual digits…
A: //C++ program #include <iostream> using namespace std; int main(){ int n,a[5],i=4;…
Q: Write a program that reads a four-digit number from user, then the program separates digits of the…
A: code
Q: Write a program that prompts the user to enter a sequence of numbers until a -999 is entered. It…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Write a program that takes a **string** as input and outputs “Binary Number” if the string contains…
A: The code is written for given problem in Python programming language. Algorithm: The algorithm for…
Q: Write a program that asks the user for a number and prints out 2 to the power of that number: Enter…
A: Given Python program to find 2^n.
Q: Write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a…
A: #include <stdio.h>//The code execution begins from the start of the main() function.int main()…
Q: make this into a problem: Here we have implemented the program that displays whether the user input…
A: Note:- always mention programming language name. This program is done using c++. logic:- read A, B…
Q: Write a program that reads some integers between 1 and 100 and counts the occurrences of each.
A: Lets see the solution.
Q: Write a Python program that asks the user for one number and tells if it a prime number or not. [The…
A: - In this program we have to check whether the number entered is a prime or not. - A prime number is…
Q: Write a program that asks the user to enter 2 integers of 4 digits and displays the different digits…
A: Use an array to store individual digits of each number and then compare these two arrays bit by bit…
Q: Write a program that reads a person's first and last names separated by a space, assuming the first…
A: To Do: To write the C++ Code.
Q: Write a program that reads text from the user and reverses the order of every number that appears in…
A: Solution:-- 1)The given question has required for the solution to be provided with the help of the…
Q: Write a program that asks a user to input the height of triangle and draw a triangle that has the…
A: I give the code in Java along with output and code screenshot
Q: Write a Python program that asks the user for one number and tells if it is a prime number or not.…
A: num = int(input("Enter the number: "))if num > 1: # Iterate from 2 to n / 2 for i in…
Q: Write a program that asks the user to enter a series of single- digit numbers with nothing…
A: number=int(input())l=[]while(number>0): remainder=int(number%10) l.append(remainder)…
Q: Write a program that asks a user to input non-negative integers (numbers that are >=0) until the…
A: I have provided C++ CODE along with CODE SCREENSHOT and 2- OUTPUT SCREENSHOTS----
Q: In python, write a program that receives an integer from the user, called n, and prints the first n…
A: In this question we need to write a python program which takes an integer input n from user and…
Q: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than 10 and…
A: Python code is given below with comment for better understanding.
Q: Write a program that prompts the user to input an integer and then outputs both the individual…
A: Requried: Write a program that prompts the user to input an integer and then outputs both the…
Q: Write a program that will compute and display the sum of the factorials of the numbers from 1 to n,…
A: Start Enter number Calculate factorial of number from 1 to n display stop
Q: Write a program that asks the user for an integer and returns an approximate integral value for its…
A: I have attached the Screenshot of the code as well as the typed code and output of the code.
Q: Write a program that prompts the user to enter the length from the center of a pentagon to a ve and…
A: Declare double type variables to store side and area of pentagon. Read distance from centre to…
please use java to answer the following question
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is 93, the output is: 93 92 91 90 89 88 Ex: If the input is 77, the output is: 77 Ex: If the input is not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.Write a program that implements a tip calculator. Your program should ask the user for the bill amount and the percentage of the tip, and then output the dollar amount of the tip and the final bill in three different formats. (see sample below) Example: Enter the bill amount: 27.95 Enter tip percentage: 17 A 17.0% tip on $27.95 equals $4.7515. The total bill is: 32.701499999999996 The total bill is $32.7. The total bill is $32.70.Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 Ex: If the input is: 11 the output is: 11 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 this is what i have n = int(input())if n > 100 or n < 11:print('Input must be 11-100')exit(0)while True:print(n, end=" ")first_digit = n // 10second_digit = n % 10 if first_digit == second_digit:break n = n-1 my output is 93 92 91 90 89 88 but it needs to be 93 92 91 90 89 88
- Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Additionally, output the distance between the starting and ending numbers (ex: 93 - 88 = 5) Note: End with a newline. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 5 Ex: If the input is: 11 the output is: 11 0 Ex: If the input is: 9 or any value not between 11 and 100 (inclusive), the output is: Input must be 11-100 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, …, 99), as that approach would be cumbersome for larger ranges. Hint: To practice incremental development, start by writing code that just outputs the countdown until matching digits and submit to get most of the points. Then, update your code to output the distance.Write a program that reads an integer between0 and 1000 and multiplies all the digits in the integer. For example, if an integeris 932, the multiplication of all its digits is 54.Hint: Use the % operator to extract digits, and use the / operator to remove theextracted digit. For instance, 932 % 10 = 2 and 932 / 10 = 93.Here is a sample run: Enter a number between 0 and 1000: 999The multiplication of all digits in 999 is 729Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and E, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by O.3, a – decreases it by 0.3. However, an A+ has value 4.0. Enter a letter grade: B- The numeric value is 2.7.
- Write a program that reads an integer and displays all its smallest factors in an increasing order. For example, if the input integer is 120, the output should be as follows: 2, 2, 2, 3, 5.Write a program that prompts the user to enter a sequence of numbers until a -999 is entered. It will print the numbers the user entered, five number in a row,with a before the first number and after the last number in each row. For example, Enter a number (-999 to stop): 23Enter a number (-999 to stop): 15Enter a number (-999 to stop): 1Enter a number (-999 to stop): 7Enter a number (-999 to stop): 9Enter a number (-999 to stop): 21Enter a number (-999 to stop): 17Enter a number (-999 to stop): 33Enter a number (-999 to stop): -999[23 15.17 9] [21 17 33]Write a program that takes a **string** as input and outputs “Binary Number” if the string contains only 0s or 1s. Otherwise, outputs “Not a Binary Number”. ===================================================================== **Sample Input 1:**\01101101101 **Sample Output 1:**\Binary Number ===================================================================== **Sample Input 2:**\12344ab0 **Sample Output 2:**\Not a Binary Number ===================================================================== **Sample Input 3:**\10127490111 **Sample Output 3:**\Not a Binary Number ===================================================================== **Sample Input 4:**\Binary Number **Sample Output 4:**\Not a Binary Number #todo#assign the result string to variable "out_str"def task3(in_str): # YOUR CODE HERE return out_str
- Write a program in Python that asks the user to enter an integer and prints two integers, root and power, such that 1 < power < 6 and root ** power is equal to the integer entered by the user. If no such pair of integers exists, it should print a message to that effect. Write the program so that if the user gives integer 64, then your program will answer that 4 ** 3 is 64, that is, it looks for the lowest root for which root ** power is the desired integer.Write a program that reads an integer age of kids, finds the maximum of them, and counts its occurances, finds the minimum of them, and counts its occurances. And Find the average ages. Assum that the input ends with number -1.Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.