1. WAP to read 2 numbers. Print the following, a. Greatest of two numbers. b. Smallest of two numbers. c. First number raised to the second number. d. Absolute value of the first number. e. Rounded value of the second number. java program
Q: QUESTION 9 What two lines of code are required to calculate different random numbers every time a…
A: PROGRAM INTRODUCTION: The function that can be used for generating a different random number for…
Q: A) Write a program to read a number and calculate if it is prime or not? Your answer
A: A positive integer that is only divisible by one and itself is referred to as a prime number.
Q: 2.Accept infinite number of positive integers from the user and display the sum. End the program by…
A: Python program to display the sum of the positive numbers. Create a variable to store the sum of…
Q: are arithmetic operations that are on the same level of precedence as multiplication? Answer: 1) 2)…
A: As per the questions asked their proper solutions are given below accurately:
Q: Question 1: Write a Java program to print the odd numbers from 1 to 99. Prints one number per line.…
A: class Test103 { public static void main(String args[]) { int i; // Loop -> From 1 to 99 for(i…
Q: Write a simplified machine language program that prints: Hello, World!
A: Write a simplified machine language program that prints: Hello, World!
Q: Do not use built in programs to do the following. Write the programs to demonstrate that you…
A: program to compute the eigenvalues and right eigenvectors of a given square array.
Q: Drow the figure using algorithms and codes. use python or java anyone language. provide the codes…
A: We use java.awt for this purpose.
Q: .. Iteration is -1 A- the repetition of a statement or block of statements in a program. B- the…
A: Given Iteration is ---
Q: 4) Give the Java statements to calculate the sum of a set of positive integers, input using a dialog…
A: Java program only to calculate the sum positive number
Q: Check each line of code and try to figure out what the errors are. Modify the code to let it run…
A: We are given 3 python small codes and we have to find out the errors in the statements. I will first…
Q: 6. Write a JAVA Program to print the output as shown below. $ $$ $$$$$$ $ $ $$$$$$$$ $ $ $$$$$$$$ $…
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will help…
Q: Using java, output the letter 'C' and make it rotate in 360 degrees clockwise.
A: // C program to rotate a matrix #include <bits/stdc++.h> #define R 4 #define C 4 using…
Q: e a Python program that prints all the numbers from 0 to 6 except 3 a
A: I have written code below:
Q: How would I do this in python? Write a program that counts for the user.Let the user enter the…
A: Solution:
Q: Write a Python program to print all uppercase alphabets along with their respective ASCII values in…
A: Write a Python program to print all uppercase alphabets along with their respective ASCII values in…
Q: Write the code of the following program in Mnemonics and show the result in SIM8085. Thanks in…
A: Algorithm: Load HL register pair with the starting address of the memory block. Move 00H to D…
Q: Write a Python program that shows how many of 3 integers are equal to each other. WRITE IN PYTHON…
A: Start Step1: take 3 numbers from user step2: if (a==b==c) print all number are equal step3: else…
Q: A palindrome is a word or a phrase that is the same when read both forward and backward. Examples…
A: Simple Algorithm: Step1: Start. Step2:Read the string from the user. Step3: Calculate length of the…
Q: Write a Python program to print absolute value of a number entered by user. write in python and show…
A: def--absolute value or modulus of a real number x, denoted |x|. i.e non negative value of that…
Q: In Python write a program to read two integers num1 and num2 from user and print the value of…
A: START INPUT num1 INPUT num2 SET result = num1*num2+num1-num2+num1/num2 PRINT result STOP
Q: Write a computer program in Fortran 90 to find sum of mod and divide two integers numbers, and then…
A: 1- In this assignment require to take the two integer number from the user and calculate the mod,…
Q: What is the error in the Python program given below to print the first 5 even natural numbers for i…
A: We are given a Python code which is suppose to print first 5 even natural numbers and we are going…
Q: 1-write a java program to check prime number.
A: As per guidelines we are supposed to answer only one question. Kindly repost the remaining questions…
Q: 1. Create a program that can accept a number and display that number as many times as the inputted…
A: Coded using Java.
Q: 1.1) Write a JAVA program to take input a decimal number n from the user and convert it from decimal…
A: Write a JAVA program to take input a decimal number n from the user and convert it from decimal…
Q: 40 + 0.23>=40.23 What is the data type of the expression value above? a.int b.String c.boolean…
A: We need to identify the datatype of the expression 40+0.23>=40.23.
Q: Write Python Program to Print all the Prime Numbers within a Given Range
A: Given Program:- Write Python Program to Print all the Prime Numbers within a Given Range
Q: write a program thar reads three numbers and prints the largest one
A: Program code: //import the required packages import java.util.Scanner; //define a class class Main…
Q: 11. Write a JAVA program to read input 2 positive integers greater than or equal to 10 and check…
A: PROGRAM EXPLANATION: Import java.util package. Create the main class. Define the main method. Ask…
Q: Exercise 2.1: Write a Java program to find the sum of first 100 natural numbers using loops in…
A: Find the sum of first 100 natural numbers using loops in Java. Solution: Initialise a variable sum=0…
Q: ALL INPUTS AND OUTPUTS OPERATIONS MUST BE DONE USING THE JOPTIONPANE. all codes in java Last month…
A: import java.util.*;import javax.swing.JOptionPane; public class Main{public static void…
Q: Answer the question below with python
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Create a Python program that reads a 10 digit long integer from the user and print the sum of all…
A: We need to write a Python program that: a. reads a 10 digit long integer from the user b. prints the…
Q: A palindrome is a word or a phrase that is the same when read both forward and backward. Examples…
A: code:- #include <iostream> #include <string> using namespace std; int main() {…
Q: Write a Java program to input 10 integers from the user and print "True" in the output if at least 7…
A: Please find the below code:
Q: Write java program and explain for the following. A. To print the pascal triangle B. To count the…
A: Given To do java :- A. To print the pascal triangle B. To count the number of vowels in the program.
Q: 2. Input from console 3 double numbers. Compare these numbers and display them from small to great.
A: ANSWER: Here I have to Provide the code, you can directly use in eclipse IDE, please find the code,…
Q: 1. Write a JAVA program to read input a number in decimal form and print the hexadecimal conversion…
A: Here I have taken input from the user and stored it into the variable. Next, I have created an array…
Q: Im trying to write a program in python to find the smallest divisor of an integer.Take integer from…
A: logic:- read an integer iterate from i=2 to n check if(n%i==0) append the value of…
Q: In F95 language read input two positive integers l and b which are the length and breadth of a…
A: Write a program in F95 language to read input two positive integers l and b which are the length and…
Q: 3. Read input two positive integers p1, p2 from the user and check whether both the integers have…
A: Write a JAVA program to read input two positive integers p1, p2 from the user and check whether both…
Q: 2. Translate below math expressions into Python expressions: a. (3 + 4)/5: b. n(n-1). 2 c. 4m2?: d.…
A: code:- print((3+4)/2) Output:-
Q: Write a python program to check whether a user entered character is alphabet or not
A: Рythоn String isаlрhа() methоd is а built-in methоd used fоr string hаndling. The…
Q: utput: an Enter A Number: 121 121 is a Palindrome number. Enter A Number: 277 277 is not a…
A: number=int(input("enter a number"))# take the number from usertemp=number # store a number in temp…
Q: B. Answer the following: By hand (pencil and paper) write what will be displayed if the following…
A: a) Output: b) Output: c) Output:
Q: Code a program in python to take input two numbers from user and print the greater number of both.…
A: Given: Two integers taken input from user. Requirement: Print the number which is greater in the…
1. WAP to read 2 numbers. Print the following,
a. Greatest of two numbers.
b. Smallest of two numbers.
c. First number raised to the second number.
d. Absolute value of the first number.
e. Rounded value of the second number.
java program
Step by step
Solved in 2 steps with 1 images
- Python Lab 2a: Input and output 1. Ask the user to enter their name. Then say hello and repeat their name. 2. Ask the user to enter their age. Print out their age 5 years from now. 3. Use concatenation and str() to print a message telling the user how old they will be in 5 years. 4. Ask the user to enter in values that might be floating point. 5. Print out the result of the calculation in a single print statement, using concatenation. 6. If Time In Python, the input() function is used to accept input. The result is stored as a string type. name = input ('what is your name?') print ('Hello ' + name) To be able to add 5 to the user input, it has to be converted to an integer. x = int(input ('what is your age?') print (x + 5) When you are printing out a string message and want to concatenate a number onto the string, use str() to convert a numeric value to a string. If the user entered 27, your output should be similar to the following: In 5 years you will be 32 years old Let's calculate…3. Read input two positive integers p1, p2 from the user and check whether both the integers have the same last digit or not. Programming language: JAVA3. Create a program that can accept 5 numbers get their sum, difference, product and quotient.USE JAVA PROGRAMMING
- write the pseudocode solution of the following exercises: a. Read two numbers, multiply them together and print out their product. b. Ask the user for a distance in miles and convert it to kilometers. Display the result (1 mile = 1.6 kilometers). c. Ask the user for his/her birth date and calculate and display the age of the user. d. Perform the following: i. Read in 5 separate numbers. ii. Calculate the average of the five numbers.Question 3 Enter 10 numbers (1-10), Print odd and even numbers. The output of your program should be: Enter 10 numbers: 1 2 . . 10 Odd number: 1 3 5 7 9 Total: 25 Even number: 2 4 6 8 10 Total: 30Hello, I am having trouble with a coding problem I am working on. I was wondering if an expert could help me with this coding problem. Its in four parts. Please let me know if you can answer this question. Thank you. Write a program that: Ask the user for number of runners For each runner: Ask the user the name of the runner Ask the user for number of runs For each run, ask the user What the distance was in miles (in decimal format, e.g. 3.1 miles is acceptable) What the time was in minutes (in decimal format, e.g. 23.9 minutes is acceptable) After gathering all the info from steps 1 & 2 above, output a summary in 3 sections: The name of each runner along with the average pace of each runner The average pace of all runs for all runners The total number of runners & runs
- You must multiply a three-digit number by a two-digit number. You properly address the issue by following the methods you were taught in fifth grade. You made use of a heuristic.b. a program.c. perceptiond. diverging thoughtWrite a program that reads two integers, a and b, from the user. Where a is equal to 17 and b is equal to 4. The program should compute and display the following: i. Sum of a and b. ii. Difference when b is subtracted from a. ii. Result of a. iv. Remainder when a is divided by b.11. Write a JAVA program to read input 2 positive integers greater than or equal to 10 and check whether the second last digit of both the numbers is equal or not.
- 1) Write a python program that reads three numbers from the keyboard and prints the sum. 2) Write a python program that reads three numbers from the keyboard and prints the average 3) Write a python program that reads three numbers from the keyboard and prints the minimum valueHelp me answer to question 2. thanks 1. Write a program to iteratively compute Fibonacci numbers (named after an Italian mathematician).Some Fibonacci numbers are 1, 1, 2, 3, 5, 8, ... where the next number is found by summing the preceding two numbers. Your program will read in a number, like 7, report the first 7 numbers. in this case1,1,2,3,5,8,13. Your program is not assured of receiving good data, thus if -2 is received as the number of numbers, then an error should be reported. 2. Assume that an input string consists of a string of 32 0’s and 1’s representing a binary number. a) Write a program that will convert this binary integer to its base 10 representation. b) Given a string representation of an integer in base 10 convert this integer to its binary representation. The output should consist of a string of 32 0’s and 1’s representing the binary number. 3. You are working for a software firm that is to develop a word processor. In order to create an efficient spell checker, you…1. Write a python program to find the sum of all even numbers from 0 to 10 2. Write a python program to read three numbers (a,b,c) and check how many numbers between 'a' and 'b' are divisible by 'c'