Write a program in java to take the value of x from user and find the value of 2*x^3 -3x^2+ 5*x+ 16 and print the results
Q: Write a JAVA program to take input the size and elements of an integer array and print the indexes…
A: Write a JAVA program to take input the size and elements of an integer array and print the indexes…
Q: Write program in Java language to take input two integer values x,y from user and print the value of…
A: Introduction : We have to write a java code which will take two numbers from the user and add their…
Q: Write a program using JAVA that converts a floating point number to the simple model of the floating…
A: Algorithm: Start the program. Generate the binary value of fraction part of float number with loop.…
Q: Write a java program, I believe the first array should only be changed. In the main method: …
A: Program Instructions: Create an array with the given values. Create another array of sizes the same…
Q: 2. In Java write a program to input the value of a double variable p and print the value of p*sin(p)…
A: ANSWER: Java Programming: One of the most generally utilized programming dialects, Java is utilized…
Q: write a java program that sums all multiples of three and five up to n (inclusive). Take the n from…
A: Required:- write a java program that sums all multiples of three and five up to n (inclusive).Take…
Q: Write a java program to take marks of student in 3 courses and calculate the total and average marks…
A: Java code for obtaining an average of marks taking inputs through Scanner class. Here it is: #Inputs…
Q: Write a Java program to find the largest index of the smallest element in a sequence of integers.…
A: import java.util.*;class Test96 { public static void main(String args[]) { Scanner sc = new…
Q: Write a program in java to find double minimum value and print that
A: Required:- Write a program in java to find double minimum value and print that Approach:- We can use…
Q: Write a Java program to take two numbers from the user and print whichever value is nearest to the…
A: Required:- Write a Java program to take two numbers from the user and print whichever value is…
Q: Write a simple java program to find greatest of three user input numbers using an array.
A: GIVEN : simple java program to find greatest of three user input numbers using an array.
Q: Write a JAVA program to input the size and elements of an integer array. Then input an integer k…
A: Your java program is here with an output.
Q: In JAVA WAP to read two non-negative integers a, b from the user and print their sum in the output…
A: Write a JAVA program to read two non-negative integers a, b from the user and print their sum in the…
Q: Write a Java Program for adding one to number represented by digits in the given array The given…
A: According to the Question below the solution: Output:
Q: Write a java program that keeps asking the user to enter a set of integers until adjacen duplicate…
A: Please find the answer below :
Q: Write a program in java to display the pattern shown below- 1 22 333 4444 55555
A: Program Approach - Declare the class and define the main method and its variables. Use two for…
Q: Write a Python program which accepts a sequence of comma-separated numbers from the user then: I.…
A: logic:- read n numbers comma separated input. set i=len(lst)-1 total=0 while i>=0…
Q: Write a Java program to find and print the first 10 happy numbers.
A: Given: Write a Java program to find and print the first 10 happy numbers.
Q: Write a Java program that determines whether a number n given by the user is outside the range ]a,…
A: Algorithm : Step 1 : create object of Scanner class. Step 2 : ask for the value of a. Step 3 : ask…
Q: Write a JAVA program to input the size and elements of an integer array. Then input an integer k…
A: Write a JAVA program to input the size and elements of an integer array. Then input an integer k…
Q: Write a Java program to read two values and interchange the values without using a third variable| 1…
A: As per the above listed problem statement we have to develop a JAVA code to read 2 values and swap…
Q: Write a Java program to take input an postive integer n from user and print the sum of integers from…
A: Given : Integer n taken input from user. Requirement: Print the sum of natural numbers from 1 to n…
Q: Write a Java Program to add two numbers without using addition operator. Take both numbers from the…
A: Coded using Java.
Q: Write a java program to display the output like the one below using multi dimensional array. 1 2 3 6…
A: We need to have 5 rows to store 0-4 and 10 columns to store 0-9
Q: Write a program in C++ Language to calculate the value of y from the following: (2x² y = 1 le-x* +1…
A: #include <iostream>#include <bits/stdc++.h>using namespace std; int main() { int x;…
Q: Write a JAVA program to input an integer i and check whether the sum of the first i elements of the…
A: Java program to solve the given problem is below.
Q: Write a java program to take three ints, a b c, print true if b is greater than a, and c is greater…
A: Java Program for above : import java.util.Scanner; class Prog{ public static void main…
Q: Write a Java program to take a number from the user and check whether its bits are in alternate 0,1…
A: Required:- Write a Java program to take a number from the user and check whether its bits are in…
Q: Write a program in assembly language that generates all prime numbers between 2 and 1000, using the…
A: Assembly Code: .LC0: .string " " SieveOfEratosthenes(int): push rbp mov rbp, rsp push rbx sub rsp,…
Q: Write a Java program called Div that takes 2 (two) double command-line arguments as inputs, dividend…
A: A required program is as follows, File name: “Div.java” public class Div { public static void…
Q: Write a Java program that counts the number of divisors of a number n given by the user.
A: Here I have taken input from the user and stored it into a variable. Next, I have declared a…
Q: Write a program in java to print odd number between 1 to 100
A: Requirement :- Write a program in java to print odd number between 1 to 100 Approach :- if a number…
Q: Write a Java program that solves a set of quadratic equations as per Requirement #1 (without using…
A: import java.util.Scanner; public class Tester{ public static void main(String[] args){ Scanner…
Q: Write a java program to display on the screen a multiplication table from 1 to n; where n is an…
A: Given that we have to make the program that can generate multiplication of the table till the given…
Q: Write a Java program that determines whether a number n given by the user is prime or not. (use:…
A: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: 2. Write a Java program to read input a positive integer n and prints the digits of the integer n…
A: Write a Java program to read input a positive integer n and prints the digits of the integer n…
Q: Write Java program that print the following series of integers 1, 5, 9, 13,…
A: class Test160 { public static void main(String args[]) { int s = 0; for(int i = 1; i <= 2005;…
Q: Write a java program to take input an array of size 5 from user and then find the maximum element in…
A: Requirements:- Write a java program to take input an array of size 5 from the user and then find the…
Q: Write a Java program that computes the product of odd numbers that are in the range [a, b] where a…
A: The question is on writing a Java program that computes the product of odd numbers that are in the…
Q: Write a Java program Write code segments that reads 12-digit card number and display the person's…
A: Algorithm: Start Read 12 digit card number as string Store last character of string in a character…
Q: Write a program in java to print the following pattern 54321 5432 543 54 5
A: Program approach: Creating a new main class Starting main method Declare variables Using two loops…
Q: Write a java program to calculate the frequency of numbers from a list of numbers. Example: Input:…
A: Solution: Java program: import java.util.Arrays; class Test { public static void…
Q: create a Java program that will generate a multiplication table. Start with the 1x table, followed…
A: Here I have created a loop to generate numbers from 1 to 12 and inside the loop I have printed the…
Q: Q7: Write a program in Java to print the Floyd's Triangle. Example: Input number of rows : 5 1 23…
A: 1) Floyd's triangle, is a right-angled triangle, which is made using natural numbers. 2) It starts…
Q: Write program in Java language to take input two integer values x,y from user and print the value of…
A: Given : Two integers x,y taken input from user. Requirement: Print the value of log(x) + log(y) in…
Q: write a simple java code to swap value of two numbers.
A: import java.util.Scanner;public class HelloWorld { public static void main(String[] args) {…
Q: Write a program in FORTRAN 90 to compute the value of s from the series below: s = x +x? + x3 +•…
A: We have total of 30 terms where the power of every term is same as the number of term and thus we…
Q: In JAVA, Write a program to input a positive integer n, and in the output print the count of all…
A: Write a Java program to input a positive integer n, and in the output print the count of all even…
Q: Write a java program to display the first 100 prime numbers.(program shouldn't be copied from net ,…
A: import java.io.*; void prime(int N){ int i, j, f; System.out.println("\n Prime…
Write a program in java to take the value of x from user and find the value of 2*x^3 -3x^2+ 5*x+ 16 and print the results
Step by step
Solved in 2 steps with 1 images
- Code language Java 1, Add a print statement to say “Multiplication Table” and then prompt theuser to enter an integer. Your program should then prints “times table” for thenumbers from 1 to the given integer (inclusive). That is, for input n, you would printa table of n rows (lines) each with n columns, where the cell at row i and columnj contains the value i × j. You do need separate rows, but don’t worry about thecolumns lining up nicely yet. 2. Add a print statement to say “Prime Testing”.Using the integer entered by the user above, print out all the prime numbers between2 and the number squared. E.g., if the user types 12 for the multiplication table part,you should print all the prime numbers that are not larger than 144.All integers are either prime or composite. A prime number is one that has no integerfactors other than itself or one. Examples are 2, 3, 5, 7, 11, 13, . . .. A compositenumber, by contrast, has multiple factors. Examples are 4, 6, 12, 15, 18, 21, . . ..Testing…code in java pls Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is: 130 50 130 the output is: 80 0 80 Find the smallest value, and then subtract it from all three values, thus removing the gray.Write a program in C that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the bingo card for a winner via 2 users Steps: 1- Ask user 1 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 2- Ask user 2 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 3- Design 2 BINGO cards as you see below 4- Distribute the numbers onto the 2 cards with each user input with 0 in the middle 5- Display the 2 cards in 1 screen as you see below 6- Generate a random number between 10-40 no duplicates / check for range and repetition 7- Compare the random number with the numbers on the 2 cards 8- If the random number matches any number on each card, change the number on the card to 0 9- Check for winning cards 5 numbers in a row or column = 0 5 numbers in a diagonal = 0 all 4 corners of the card = 0 if any of the players won, display who is the winner and exit the program if the 2 players won, display both are…
- In JAVA code (Insertion Sort): 1. Prepare a data set containing 10,000 integers (random). 2. Make a code that will create 3 variants of the data: one in best case (data are arranged in ascending order); the other in worst case (data are arranged in descending order); and the last in average case (data are randomly arranged). 3. Each integer is considered as one input in the code. 4. The output of your program should be the number of statements executed in the process of sorting for each of the algorithms. This, therefore, means that you have to embed a counter variable in your program that keeps track of the number of statements executed in the sorting part of your code. 5. The end value of the variable shall be the output of your program. Below is a sample of the code in Bubble Sort; I am asking for the program for insertion sort.In JAVA code (Insertion Sort): 1. Prepare a data set containing 10,000 integers (random). 2. Make a code that will create 3 variants of the data: one in best case (data are arranged in ascending order); the other in worst case (data are arranged in descending order); and the last in average case (data are randomly arranged). 3. Each integer is considered as one input in the code. 4. The output of your program should be the number of statements executed in the process of sorting for each of the algorithms. This, therefore, means that you have to embed a counter variable in your program that keeps track of the number of statements executed in the sorting part of your code. 5. The end value of the variable shall be the output of your program.Write a code in C or Python that asks three integers from user and finds the greatest of them.
- In java Develop a function that takes two integers and returns the sum of the values from the first to the second (the two inputs may be in any order). Call the function at least twice with different arguments Develop a void function PrintLineOfChar that accepts a single character and an integer. The function prints a single line of the character repeated the integer number of times. Call the function at least twice with different arguments.Part1: Java Programming Without using function 1. Write a program that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as 1 6 3 8 413. Write a Java program that reads two integers num1 and num2. If num1 is greater than num2, then swap (exchange) them. Next, your program must display all numbers from num1 to num2 on a single line such that every line contains the number followed by all its divisors (see sample input/output below.) Sample Input/Output Enter two numbers: 20 25 Number Divisors 20 4 10 20 21 21 22 11 22 23 23 24 4 12 24 25 25
- Write a code in C++: Write a program to factor a polynomial of the form x² + bx + c, where b and c are integers AND also modify the program so that it can also factor polynomials of the form ax2 + bx + c , where a, b, and c are integers. For example, the polynomial "- 2x² - 3x + 2" can be factored as: "- 2x² - 3x + 2 = (-2x + 1)(x + 2) = - (2x - 1)(x + 2)". The output at the end should be this exact quote: "- 2x² - 3x + 2 = (-2x + 1)(x + 2) = - (2x - 1)(x + 2)"Instruction: Write a Java program that reads a positive, non zero integer as input and checks if the integer is deficient, perfect, or abundant. A positive, non-zero integer, N, is said to be perfect it the sum of its positive proper divisors (i.e., the positive integers, other than N itself, that divide N exactly) is equal to the number itself. If this sum is less than N, the number is said to be deficient. It the sum is greater than N, the number is said to be abundant. The first few perfect numbers are 6, 28, 496, and 8128. | Illustrations: Number 6. 28 For example, the number 6 is perfect, since 6 = 1 + 2 + 3, the number 8 is deficient, since 8>1 + 2+ 4, while the nurmber 12 is abundant, since 12<1+2+3+4+ 6. | Factors of the number less than itself | Sum of Factors 3. 2. 1 14, 7, 4, 2, 1 6. 28 Sample Input/Output: Depicled below are sample oulputs when the program is execuled (Ihe ilems in bold characters are input from the user, while the items in bold italic are calculated and…Write a code in C++: Write a program to factor a polynomial of the form x² + bx + c, where b and c are integers AND also modify the program so that it can also factor polynomials of the form ax2 + bx + c , where a, b, and c are integers. Note that the polynomial _ - 2x² - 3x + 2_ can be factored as: _ - 2x² - 3x + 2 = (-2x + 1)(x + 2) = - (2x - 1)(x + 2)_.