* Applet Viewer: ButtonDemo.class Applet Applet started. Sunny Cloudy X
Q: Write a Java program called BubbleSort that takes an input array [50, 11, 33, 21, 40, 50, 40, 40,…
A: Algorithm : Start Take input from the user for the size of the array. Create an integer array of…
Q: Write a sample Java code that run of the program should look something like output:
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT-----------------
Q: Statistics are often calculated with varying amounts of input data. Write a program that takes any…
A: Here, we have to write a program that takes any number of non-negative integers as input and outputs…
Q: This is for Java Programming In my code, I'm missing a new line at the end of an array. I'm not…
A: for (i = 0; i < n; i++) array[i] = scnr.nextInt(); a = scnr.nextInt();…
Q: Write a java method that takes a full name from the user, and converts each start letter in the…
A: 1. make an object of the scanner class 2. input a string 3. call the function 4. split the string…
Q: Write a program in BGI to draw a line using DDA algorithm
A: Include necessary libraries. Initialise required variables. Call graph function. Ask for user…
Q: Create a graphical JAVA program that simulates a simple arcade game (like Frogger) using the ACM…
A: Code for particular section :- public void drawRoadMarkers() { / Draw the solid dividing lines…
Q: Write a JAVA program that reads one line of input text and breaks it up into words. The (solution)…
A: Program is: import java.util.*; import java.util.Scanner; //Defining class Words public class Words…
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: NO Universe.java NETHERESCONOWNI 2 public class Homework1 { 10 11 12 13 14 mainClass.java 15 16} 17…
A: Start.Initialize a variable sum to 0.Iterate from 0 to 7 using a loop.Check if the current number is…
Q: Please code in JAVA and follow the instructions as it is mentioned.. please refer the images…
A: import java.util.*;public class Main{ public static void main(String[] args) { //declare…
Q: Slope Y-Intercept Project Data can be modeled by a linear equation. Two values that define a linear…
A: def get_slope(p1,p2): x1,y1=p1 x2,y2=p2 if(x1==x2): return None else: slope=(y2 - y1)/(x2 - x1)…
Q: ' for 5 seconds then display the word "gorgeous' for another 5 seconds. Then i need it to countdown…
A: In this task, we're going to be exploring several aspects of Arduino programming with the help of…
Q: A robot is initially located at position (0, 0) in a grid [−5, 5] × [−5, 5]. The robot can move…
A: Program code: //include the required header files #include <iostream> /* srand, rand */…
Q: Kinetic energy is given by x object Mass x objectVelocity × objectVelocity. Write a program that…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: 2. Write a Java program that takes an input string and determines the number of consonants, vowels…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Write a program that will draw the following shapes, take size from the user as input * * * * * * *…
A: code: //header files #include<iostream> using namespace std; int main() //main method…
Q: Write code which prints every number from 10 to 1 a number of times equal to the number itself (e.g.…
A: We will run two for loops to get the job done The first for loop will tell us the number to print…
Q: Program 5: : Input first and last names and display the name in the format of last name, first name…
A: EXPLANATION: - The String variables for firstName and lastName are declared. To read the input from…
Q: Test the follow code step by step. Add enough detail to justify the use of OOP concepts in this…
A: Sample Response: //Java programming language//Public class Pet definition, base classpublic class…
Q: In console.log() function in JavaScript a newline character is automatically printed at the end. So,…
A: Write a Javascript program to show how to print a text without printing the newline character.
Q: odify the program below to implement exclusive-or (XOR) in Python. As Python does not natively…
A: Task : Complete the code for the implementation of XOR operation using python.
Q: Write a program that prints out the letters of a word, one on each line, in the format "The letter…
A: Logic :- use split() method to separate string and store it in array. display each word of array.
Q: Write a java program that reads a line of input as a sentence and displays: • Only the uppercase…
A: We need to create a Java program that reads a line of input as a sentence and prints- only…
Q: Modify the code to display the current date in the MM/DD/YYYYmode. And, display the number of hours,…
A: Required: Modify the code to display the current date in the MM/DD/YYYYmode. And, display the number…
Q: I want method that take input from user in java that do: Text Analyzer: Count words, characters,…
A: The objective of the question is to create a simple text analyzer in Java that can perform various…
Q: Write a program to remove all white spaces from a string in Java.
A: In Java, you can remove all white spaces from a string by using various approaches. One common…
Q: Write a Java program that prints the numbers from 1 to 100. But for multiples of 3, print "Fizz"…
A: Iterate from 1 to 100.If the current number is divisible by both 3 and 5, print "FizzBuzz".Else if…
Q: b. Using Grid Layout to set 9 bottons like the following picture (use frame size 350,350):
A: The Java GridLayout class is used to arrange the components in a rectangle grid. One component is…
Q: Write a Java Program: Using a for loop, fill the array a with 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2,…
A: Please refer to the following steps for the complete solution to the problem above.
Q: in java Use scnr.nextInt() to read integers from input into inputData until 1000 is read. For each…
A: The objective of the question is to read integers from the input until the sentinel value 1000 is…
Q: I need help adding a new line at the end of the output string here is my Java code, and it is all…
A: There are two ways to put a new line after the output is printed in the given code. Given JAVA code:…
Q: Calendar. In this project, you will be asked to write code to implement a calendar, taking into…
A: Project : 1- Calendar. In this project, you will be asked to write code to implement a calendar,…
Q: I need help with the Java code so that it can output as shown in the image below: Input is a csv…
A: This Java program reads movie data from a CSV file, organizes it by movie title, and outputs the…
Q: Write a Java Program to take 3 integers(a.b.c) from the user, print "Great Number" if one of b or c…
A: Find greater number, far number or ugly number as per the given condition.
Q: 1. Write a program that takes a two digit number and prints the number backwards.
A: As per the rules of Bartleby i can only solve 1 question at a time if they are not interrelated so…
Q: You are working as a software developer on NASA's Mars Explorer robotic rover project. You need to…
A: Algorithm: 1. Define a function that takes three parameters (r, n, h).2. Calculate the surface area…
Q: Write a Java program that prints rectangles of three different sizes to the screen, with a blank…
A: Answer the above program are as follows:
Q: se python code with "def drawItem(img,item,row,col):" but without using cv2,PIL or numpy…
A: image is an np array you can do any operation numpy provides
Write java code for the output to look like said picture.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- I could really use some help with a problem I got for coding. A screenshot showing an example would help.//Below is my current code I'm close to having it finished but my output differs from the required output as posted in the images below. I would like to know what i need to change in my code to get the correct output. Thank you. import java.util.Scanner; public class ShoppingCartPrinter { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int i = 0; String productName; int productPrice = 0; int productQuantity = 0; int cartTotal = 0; ItemToPurchase item1 = new ItemToPurchase(); ItemToPurchase item2 = new ItemToPurchase(); System.out.println("Item 1"); System.out.println("Enter the item name: "); productName = scnr.nextLine(); System.out.println("Enter the item price: "); productPrice = scnr.nextInt(); System.out.println("Enter the item quantity: "); productQuantity = scnr.nextInt(); scnr.nextLine(); item1.setName(productName);…I need help with the content on the image below. The Code is Java.
- Create a program to generate the final quantization value of the source image. You need to code the DCT and use the quantized table above. Finally, upload the followings 1. source code(C or python) 2.(quantized 8*8 values) the image of the result 70 72 70 70 72 68 68 64 103 101 103 100 99 97 94 94 132 132 132 130 129 129 125 121 157 157 155 154 153 150 148 145 168 163 164 162 163 161 161 156 172 170 165 166 163 163 162 158 174 170 167 167 164 163 164 159 174 173 170 167 167 166 166 160 Input image Quantization Table 16 11 10 16 24 40 51 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 luminance tablecan you please solve this ? Adopting suitable Java primitives and based on the least significant digit of your ID, implement one of the following shapes: (the car image is the one i need) b) Snapshot the output of a) c) Use suitable rendering to fill-in the shape suitably using suitable and well aligned-texture to reflect the real shape of your drawing.Help writing a Java program (please provide photos it works so I'm not studying a nonworking program) Write a complete version of the Bresenham Midpoint algorithm to handle ALL slope values. Include appropriate tests for ‘special case’ conditions. Instead of “WritePixel” write to the screen the coordinates of the pixel that would be drawn. Your program must implement the algorithm given in class with modifications to handle the special cases. Different slope values: m = 0, m = 1, m = > 1, m = infinity (needs special test case) , m < 0 (swap x and y) The user should be able to enter coordinates and it should output the coordinates it takes to draw from the first point to the last point
- I submitted pictures and pasted my code here. My issue is that I do not how to do to make the code work when the string is more than one word. (the instructions are in the pictures attached). This is using Java. public static void printPalindrome(Scanner console ) {System.out.print("Type one or more words: ");String message= console.next();boolean palindrome= true;int lengthOfMessage= message.length();for(int i= 0; i<message.length(); i++) {if (Character.toLowerCase(message.charAt(i)) != + Character.toLowerCase(message.charAt(lengthOfMessage-1-i))) {palindrome = false;}}if (palindrome == true) {System.out.println();System.out.print(message+ " is a palindrome!");}else {System.out.println();System.out.print(message+ " is not a palindrome");}}I already saw a solution to this problem here, but it is not correct The edge-detection function (detectEdges) described in Chapter 7 and shown below returns a black and white image. Think of a similar way to transform color values so that the new image is still in its original colors but the outlines within it are merely sharpened. def detectEdges(image, amount): """Builds and returns a new image in which the edges of the argument image are highlighted and the colors are reduced to black and white.""" def average(triple): (r, g, b) = triple return (r + g + b) // 3 blackPixel = (0, 0, 0) whitePixel = (255, 255, 255) new = image.clone() for y in range(image.getHeight() - 1): for x in range(1, image.getWidth()): oldPixel = image.getPixel(x, y) leftPixel = image.getPixel(x - 1, y) bottomPixel = image.getPixel(x, y + 1) oldLum = average(oldPixel) leftLum = average(leftPixel)…Using the Card.java class file, write a program to simulate a Deck of Cards. See Programming Project 8.7 (PP 8.7) from page 403 of your textbook (or view the attached image) for a description of what your program needs to do. Note that although the book description of the problem states that you should write the Card class, I do not want you to do that. You must use the Card file exactly as it is provided (NO modifications) and only write the DeckOfCards and Driver classes. public class Card{public final static int ACE = 1;public final static int TWO = 2;public final static int THREE = 3;public final static int FOUR = 4;public final static int FIVE = 5;public final static int SIX = 6;public final static int SEVEN = 7;public final static int EIGHT = 8;public final static int NINE = 9;public final static int TEN = 10;public final static int JACK = 11;public final static int QUEEN = 12;public final static int KING = 13; public final static int CLUBS = 1;public final static int DIAMONDS =…
- Please take the user input in java other than using scanner object . Take two elements by one input and then multiply both of themWrite a javascript that generates hundred decimal random numbers up to three decimal places in range 17 to 82 (including 17 and 82). Among these hundred random numbers, your program should output how many of them are in the range 51 to 60 (including 51 and 60). (Random numbers should be in the given range. If they are below 17 or above 82, you will be given zero points.)Write a Java program which reads a 3-digit number from command-line and prints whether that number is an Armstrong number or not.A 3-digit Armstrong number is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 33 + 73 + 13 = 371, but 173 is not an Armstrong number.Sample output (assuming the command line argument is 371):The number is an Armstrong number