Fill out Blank_A and Blank_B with Java code. public Blank_A printMyMessage () { String threadName = Blank_B; System.out.println(threadName + " : " + this.myMessage + ", i = " + ++i); }
Q: What does the following program print? 1 void *helper(void *arg) { 2 int *num = (int*) arg; 3 *num =…
A: According to the Question Below the solution:
Q: Please run this program. Thank you import javax.swing.*; import java.awt.*; public class…
A: 1. Save the program wih the same name of class. 2. Use the command prompt to run the program. 3.…
Q: In Java programming Write the code to print out an inventory report. Your code must read each…
A: In Java programming Write the code to print out an inventory report. Your code must read each…
Q: Write a method swapArrayEnds() that swaps the first and last elements of its array parameter. Ex:…
A: Java Programming is the object oriented programming languages. It is used to create the web…
Q: Given main(), define a Course base class with methods to set and get private fields of the following…
A: The question asks to create a Java program that represents course information, including details…
Q: JAVA PROGRAM THIS PROGRAM MUST WORK IN HYPERGRADE. I HAVE PROVIDED THE INPUTS ARS A SCREENSHOT HERE…
A: The Java program "NameSearcher" searches popular boy and girl names. Users may input a name to check…
Q: package pwriter2; import java.util.Scanner; import java.io.*; public class Pwriter2 {…
A:
Q: Write code that gets the tenth item in the list, assigning it to an appropriate variable. (java)
A: Create an ArrayList called folders to store EmailFolder objects. Add EmailFolder objects to the…
Q: Define a method findMenuCost() that takes two integer parameters as the menu chosen and the number…
A: We must complete the Java program to find the cost per person per the given inputs.There are two…
Q: import java.util.Scanner; public class WinningTeam { public static void main(String[] args) {…
A: Class Definition:Define a class named Team.Declare private instance variables: name (String), wins…
Q: Please fix errors for the java code below. The program is a t square fractal (image below)
A: To create a T-square, start with a square canvas. We create T-square using java language.Java is a…
Q: Counting threads Write a java program that asks the user for two different positive integers. Use…
A: The given task requires us to write a Java program that takes two positive integers as input from…
Q: As always, put your Assignment number, name, and class section in a block comment at the beginning…
A: Here I have created the class named VotingMachine. Inside the class, I have created static variables…
Q: In C++ class rectangleType { public: void setLengthWidth(double x, double y); //Sets the…
A: A C++ program to compute the area and perimeter of a rectangle using class structure.
Q: Creates a frame with the specified size // that is twice as tall as wide import javax.swing.*;…
A: In the given code there are three errors, i update the code to be bug free.
Q: public class arrayOutput { public static void main (String [] args) { final int NUM ELEMENTS = 3;…
A: Program Approach : This program initializes an integer array userVals with three values and then…
Q: There is an ERROR in this code: import java.util.Scanner; public class TestPhoneBook { public…
A: Solution: Corrected code: Note: changes made shown with bold in code- TestPhoneBook.java…
Q: package edu.luc.cs.cs271.mazesolver; import java.util.ArrayList; import java.util.Scanner; public…
A: File: maze.py Project 7.9 Determine the solution to a maze problem. Uses a gid to represent…
Q: Programming Exercise 5-5A Instructions PastPresentFuturejava + >- Terminal 1 import java.util.*; 2…
A: Java Code: import java.util.*;import java.time.*;import java.util.Calendar;import java.util.Scanner;…
Q: Write an if-else statement for the following: If userTickets is less than 6, execute award Points =…
A: Your given program is logically correct but the issue is in the closing of blocks. Blocks were…
Q: Please can I get a flowchart and pseudocode for this java code. Thank you. TestScore.java import…
A: Objective: We need to draw a flowchart and depict pseudocode for the given Java program. A…
Q: In Java MailBox - client:String - emails: Email[] - actualSize: int + Mailbox() +…
A: In this question we have to implement a Java code for Mail Box class Let's understand and code,…
Q: java The following is a valid interface definition in java: public interface FileOperator {…
A: We are going to check whether the interface defined is valid or not.
Q: This program loops through fileLoop.txt, computation, and display results package charioloop;…
A: The code has given
Q: Write an application that displays the name, containing folder, size, and time of last modification…
A: JAVA PROGRAM: import java.nio.file.*; import java.nio.file.attribute.*; import java.io.IOException;…
Q: (2) Exhibit.java private DisplayType dType ArrayList of Artifacts public enum DisplayType - wall,…
A: START Create a file called Exhibit.java Inside the Private section. Define a variable for Display…
Q: // JumpinJive.java - This program looks up and prints the names and prices of coffee orders. //…
A: Use a loop to iterate and search and updated foundIt if requested addOn found in array
Q: import java.util.Scanner; public class DebugSix3 { public static final int TIME_WASTER = 500;…
A: Import the Scanner class.Define the constant TIME_WASTER with a fee of 500.Define the primary…
Q: import java.util.Scanner; public class MealEstablishmentDirectory { public static void main…
A: Java class named MealEstablishment with three methods: setRating, setState, and print. These methods…
Q: Multiple choice in java Given the following code snippet: ArrayList shapes = new…
A: Given: Scanner scan1=new Scanner(new File("D:\\AAUJ\\AAA\\radiusInfo.txt")); //This statement is…
Q: Turtle Hare Race - Multithreading Use Java multithreading to implement the turtle hare race…
A: The turtle hare race is a basic example used in multithreading. The code implementation is given…
Q: Write this program in Java using a custom method. Implementation details You will implement this…
A: This program uses a do-while loop to run the game engine until the user decides to quit or runs out…
Q: a Programming exercise: Create a class called Collatz Create the main method Inside, create these…
A: Program Approach: 1- Debug the code line by line, the code is fine but there is some logical…
Q: The following code has numerous errors that need to be fixed. import java.util.Scanner; public…
A: Here are the changes made to the code: Added a missing closing parenthesis in the while loop…
Q: edit and finish class authenticate below do not give a solution (example copying from another source…
A: the program is an given below:
Q: import java.util.Scanner; public class TriangleArea { public static void main(String[] args) {…
A: After completing the code, I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: Exception in thread "main" java.lang.NumberFormatException: For input string: "x" for Java code…
A: The Java code that is provided introduces sumIt and findMax, two recursive procedures that are part…
Q: The file Names.txt is located in the folder input_files within your project. The content of that…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: this does not work in Eclipse Java, please you can fix it?
A: Answer: This is working fine in eclipse, if the program is having errors then you need to import the…
Q: I have the following code: import java.util.*; import java.io.*; public class GradeBook…
A: Solution: This error comes because MIDTRM_MAX_POINTS is defined as MIDTEM_MAX_POINTS in…
Q: import java.util.Scanner; public class StateInfo { /* Your code goes here */ public static…
A: Algorithm:Define Method printStateInfo:Define a method named printStateInfo that takes two…
Q: import java.util.Arrays; import java.util.Random; public class Board { /** * Construct a puzzle…
A: The question is related to 5x5 puzzle game. Where Board will be Main Class. public Board(int moves){…
Q: import java.util.Scanner; public class CharMatch { public static void main(String[] args) {…
A: Introduction : Explanation : This program is designed to check if a character in a given string…
Q: import java.util.Scanner; public class ParkingFinder { /* Your code goes here */ public…
A: In this question we have to write a java program for the Daily Parking Price System Let's code and…
Q: Write a program that reads a course's title and enrolled student information (student id, student…
A: Program Description: Define the Student class which gets the id and score of the student. Define…
Q: public string SomeMethod(string OriginalZip) { string zip = "Zip Not Available"; zip = GetZip(zip,…
A: Answer:
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- public int getPowerUse(){ return super.getPowerUse() + contents * powerRating; //////////////////////////////////////////////// if (args[0].equals("REFRIGERATOR")) { String manufacturer = args[1]; String serialNo = args[2]; int basePower = Integer.parseInt(args[3]); int powerRating =Integer.parseInt(args[4]); int capacity = Integer.parseInt(args[5]); Refrigerator rf=new Refrigerator(manufacturer,serialNo, basePower, powerRating, capacity); things[rf.getId()]=rf; returnval = rf.getId(); }public static CS150 getInstance(){ //TODO implement a single return null; }mport java.nio.file.*;import java.nio.file.attribute.*;import java.io.IOException;public class PathDemo5{ public static void main(String[] args) { Path myPath = Paths.get("C:\\Java\\Input.Output\\MyData.txt"); try { ---------Code here ---------- System.out.println("Creation time " + attr.creationTime()); System.out.println("Last modified time " + attr.lastModifiedTime()); System.out.println("Size " + attr.size()); } catch(IOException e) { System.out.println("IO Exception"); } }}Using the above code, create a statement on the indicated line that uses the readAttributes() method of the Files class that takes two arguments—the Path object created in the code and a BasicFileAttributes.class—and returns an instance of the BasicFileAttributes class named attr.
- StringFun.java import java.util.Scanner; // Needed for the Scanner class 2 3 /** Add a class comment and @tags 4 5 */ 6 7 public class StringFun { /** * @param args not used 8 9 10 11 12 public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Please enter your first name: "); 13 14 15 16 17 18 System.out.print("Please enter your last name: "); 19 20 21 //Output the welcome message with name 22 23 24 //Output the length of the name 25 26 27 //Output the username 28 29 30 //Output the initials 31 32 33 //Find and output the first name with switched characters 34 //All Done! } } 35 36 37import java.util.Scanner; public class Inventory { public static void main (String[] args) { Scanner scnr = new Scanner(System.in); InventoryNode headNode; InventoryNode currNode; InventoryNode lastNode; String item; int numberOfItems; int i; // Front of nodes list headNode = new InventoryNode(); lastNode = headNode; int input = scnr.nextInt(); for(i = 0; i < input; i++ ) { item = scnr.next(); numberOfItems = scnr.nextInt(); currNode = new InventoryNode(item, numberOfItems); currNode.insertAtFront(headNode, currNode); lastNode = currNode; } // Print linked list currNode = headNode.getNext(); while (currNode != null) { currNode.printNodeData(); currNode…Assign the size of userlnput to stringSize. Ex: if userlnput is "Hello", output is: Size of userInput: 1 import java.util.Scanner; 2 3 public class StringSize { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); String userInput; int stringSize; 4 5 8 9. userInput scnr.nextLine(); %3D 10 11 /* Your solution goes here */ 12 13 System.out.println("Size of userInput: + stringSize); 14 15 return; } 16 17 }
- 8) Now use the Rectangle class to complete the following tasks: - Create another object of the Rectangle class named box2 with a width of 100 and height of 50. Note that we are not specifying the x and y position for this Rectangle object. Hint: look at the different constructors) Display the properties of box2 (same as step 7 above). - Call the proper method to move box1 to a new location with x of 20, and y of 20. Call the proper method to change box2's dimension to have a width of 50 and a height of 30. Display the properties of box1 and box2. - Call the proper method to find the smallest intersection of box1 and box2 and store it in reference variable box3. - Calculate and display the area of box3. Hint: call proper methods to get the values of width and height of box3 before calculating the area. Display the properties of box3. 9) Sample output of the program is as follow: Output - 1213 Module2 (run) x run: box1: java.awt. Rectangle [x=10, y=10,width=40,height=30] box2: java.awt.…import java.util.*; public class Budgeter {public static void main(String[] args) {Scanner console = new Scanner(System.in); please use java and start the code the way provided and do NOT use \n or printf in the code please.Java Programming I have a Java program with a restaurant/store menu. Can you please edit my program when displaying the physical receipt (I'm missing the menu items.) Task: When the user selects the items they would like to order on the physical receipt it should display the items as well. Can this be completed? My program is below: import java.util.Scanner; public class Restaurant2 { publicstaticvoidmain(String[] args) { // Define menu items and prices String[] menuItems= {"Apple", "Orange", "Pear", "Banana", "Kiwi", "Strawberry", "Grape", "Watermelon", "Cantaloupe", "Mango"}; double[] menuPrices= {1.99, 2.99, 3.99, 4.99, 5.99, 6.99, 7.99, 8.99, 9.99, 10.99}; StringusersName; // The user's name, as entered by the user. // Define scanner object Scannerinput=newScanner(System.in); // Welcome message System.out.println("Welcome to AppleStoreRecreation, what is your name:"); usersName = input.nextLine(); System.out.println("Hello, "+ usersName +", my name is Patrick nice to…
- Modify this code to make a moving animated house. import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.Graphics2D; /**** @author**/public class MyHouse { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(750, 500); panel.setBackground (new Color(65,105,225)); Graphics g = panel.getGraphics(); background(g); house (g); houseRoof (g); lawnRoof (g); windows (g); windowsframes (g); chimney(g); } /** * * @param g */ static public void background(Graphics g) { g.setColor (new Color (225,225,225));//clouds g.fillOval (14,37,170,55); g.fillOval (21,21,160,50); g.fillOval (351,51,170,55); g.fillOval (356,36,160,50); } static public void house (Graphics g){g.setColor (new Color(139,69,19)); //houseg.fillRect (100,250,400,200);g.fillRect (499,320,200,130);g.setColor(new Color(190,190,190)); //chimney and doorsg.fillRect (160,150,60,90);g.fillRect…import java.util.Scanner; public class Playlist { // TODO: Write method to ouptut list of songs public static void main (String[] args) { Scanner scnr = new Scanner(System.in); SongNode headNode; SongNode currNode; SongNode lastNode; String songTitle; int songLength; String songArtist; // Front of nodes list headNode = new SongNode(); lastNode = headNode; // Read user input until -1 entered songTitle = scnr.nextLine(); while (!songTitle.equals("-1")) { songLength = scnr.nextInt(); scnr.nextLine(); songArtist = scnr.nextLine(); currNode = new SongNode(songTitle, songLength, songArtist); lastNode.insertAfter(currNode); lastNode = currNode; songTitle = scnr.nextLine(); } // Print linked list…import java.util.Scanner; public class FridayData { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Friday weather = new Friday(); String inputWeather; double inputHumidity; inputWeather = scnr.next(); inputHumidity = scnr.nextDouble(); weather.setWeather(inputWeather); weather.setHumidity(inputHumidity); weather.print(); }}
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)