36,051 Topics
![]() | |
hi! I'm currently studying and having difficulty being able to print the array list, im not sure where im going wrong. any help will be appreciated import java.util.*; public class practice { static Scanner sc = new Scanner (System.in); static int numberOfCoffees = 0; static String[][] coffee = new String … | |
So im just starting learrning code, and I am also using code.org as a starter tool. I'm on a lesson where it says to; write a program that simulates the rolling of two dice. Keep rolling the dice UNTIL the sum of the dice is either a 7 OR an … | |
public class BusPayment extends JFrame{ private JButton paynow; private JButton cancel; private JComboBox<String> jComboBox1; private JFrame frame; private JLabel label1, label2, label3, label4; private JPanel panel1, panel2,panel3; private JRadioButton destination1; private JRadioButton destination2; private JRadioButton destination3; private JRadioButton destination4; private JRadioButton destination5; private JRadioButton destination6; private JComboBox company; private JTextField … | |
First: Design a class named Employee with private fields for that person’s: (1) name, (2) ID number, and (3) hire date. The ID number should be in the format ###–C, where # is a digit, 0–9, and C is a character, an uppercase letter, A–M. Write no-arg, 1-arg (name), 2-arg … | |
Getting errors and having a hard time seeing where. If I get it to build it is ignoring the inputmenu. package personalprogram; import java.util.Scanner; /** * * @author mitch */ public class PersonalProgram { /** */ public final class InputMenu { public void display_menu() { System.out.println("1) Calculate Cubic feet per … | |
Hi. I'm trying to create a Traffic simulator and I'm stuck on how to get a Car object to turn into a road. I've managed to have a car go straight (which is really easy anyway lol) but I can't really find a way to get it to turn into … | |
hi all i am making a weather data program and i having a problem for bringinng my text file to the table. here i am putting all my code . and i also have to import a second output window for my code. for example when ever i enter ome … | |
public int evaluate() { if (root == null) { return -100000; } return evaluateHelper(root); (error) } private int evaluateHelper(MyBinaryTreeNode rt) { if (rt.left == null) { return Integer.parseInt(rt.data.toString()); (error) } switch (rt.data.toString()) { case "+": return evaluateHelper(rt.left) + evaluateHelper(rt.right); case "-": return evaluateHelper(rt.left) - evaluateHelper(rt.right); case "/": return evaluateHelper(rt.left) / … | |
Hi to all! I have SQL Server Express, SQL Server Management Studio 2012. My PC Name is : "SaboorPC" and SQL Server instance name is also "SaboorPC". I am trying to connect my Netbeans to My SQL Server but it is not connecting and giving the following error: "com.microsoft.sqlserver.jdbc.SQLServerException: The … | |
***java*** i have a assignment of oop by using java can any body help me pz : Design and implement these four classes Employee, MonthlySalEmployee, HourlySalEmployee, Company and implement the following functions: ⦁ Create an application class with N HourlySalaryEmployee objects and N MonthlySalEmployee objects. ⦁ Create constructors, accessor and … | |
I am working on a reservation app in Java and it is almost complete but I keep getting this error when running my app: Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at ReservationCalculator.main(ReservationCalculator.java:34) Full Code import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; import java.util.Scanner; public class ReservationCalculator { … | |
Hi, I am trying to create a reserve console app using Java. Any Help is appreciated. The Params are: Calculate reservation totals Welcome to the Reservation Calculator Enter the arrival month (1-12): 5 Enter the arrival day (1-31): 16 Enter the arrival year: 2016 Enter the departure month (1-12): 5 … | |
While coding a random program about how Convenient the program was for the user , I use Scanner, and its .nextInt(); to ask the user to rate the program's Convenience: 275.Scanner scan = new Scanner(System.in); 276.System.out.println("Rate the convenience of this program by typing 1 to 5..."); 277.System.out.println("1. *"); 278.System.out.println("2. * … | |
hey, i'd like to know if there is a java program that transformate 2D dicom images to 3D dicom images? | |
`import java.util.*; import java.time.*; public class Customer import java.util.*; import java.time.*; public class Customer{ private String name; private int custID; static int nextCustID = 100; ArrayList<Rent> rents = new ArrayList<Rent>(); public Customer(String n){ name = n; custID = nextCustID++; } public void addRent(int copyNo, LocalDate date, int days){ Rent r … | |
hi i want some change in this code. let one writer, one reader at the same time. Writer has preference. package test; import java.util.concurrent.Semaphore; class ReaderWritersProblem { static Semaphore readLock = new Semaphore(1); static Semaphore writeLock = new Semaphore(1); volatile static int readCount = 0; static class Read implements Runnable … | |
Hi all, Can anyone help me implement push pop instruction and call recall function in the wombat one program. Im a newbie to these things so it will be helpful if anyone could just take me step by step on what to do. many thanks. | |
Hi can anyone help me convert these codes into java and let me know which classes are to have? // Clustering.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <string.h> #include "MersenneTwister.h" #define CATAGORICAL_CONST 30.0 #define MAX_FILENAME_SIZE 500 #define MAX_BUFFER_SIZE 500 #define MAX_STRING_SIZE 100 #define … | |
I'm using android studio to create a multiple choice question app, and i've coded the quiz but so far it just goes on forever. I want to make it so that once the user has answered 20 questions, whether they are right or wrong, the game ends and sends them … | |
Hi guys, I seem to have an issue with a boolean method returining a value. Here is the code excerpt - irrelevant code omitted: public class StreamsTest { public static void main(String[] args) { String[] arr = new String[]{"a", "b", "c"}; //convert array to string with streams List<String> list = … | |
Just a quick question, I'm trying to speed up my app and I've seen forum posts where people say reducing the size of pictures speeds up their app. I was hoping to replace my exit cross in the top corner of my app (which is a png because I drew … | |
//With this method, I input a string and return an array that contains a sorted list of characters as per the frequency. Eg: If i input "apple", the out put should be p,a,l,e, How do I do this? public static ArrayList<Character> characterFreqDist(String statement) { char[] Array = statement.toCharArray(); int length … | |
We have completely redesigned our website but am not sure about the page content whether its enough to get ranked on search engines? What are all the possibilities available to get ranked immediately on the first page of google - https://www.dezvolta.com/ | |
Need Help! Here's the first production worker. Exception in thread "main" java.lang.IllegalArgumentException: Multiple decimal separators in pattern "#.##0.00" at java.text.DecimalFormat.applyPattern(DecimalFormat.java:2519) at java.text.DecimalFormat.<init>(DecimalFormat.java:416) at ProductionWorker.toString(ProductionWorker.java:42) at java.lang.String.valueOf(String.java:2826) at java.io.PrintStream.println(PrintStream.java:771) at WorkerDemo.main(WorkerDemo.java:10) Java Result: 1 BUILD SUCCESSFUL (total time: 8 seconds) // Employee Class public class Employee { private String name; private … | |
/** This code is supposed to take the user input of the length and breadth of the room in one class, get the user input of the material and cost from the other class and calculate the total cost.*/ import java.util.Scanner; //My first class class RoomFlooring { private String FloorMaterial; … | |
import java.util.Scanner; class Room_Dimension { private double length; private double width; public Room_Dimension(double length, double width) { this.length = length; this.width = width; } public void setLength(double length) { this.length = length; } public void setWidth(double width) { this.width = width; } public double getLength() { return length; } public … | |
Hi, how do I sort the string in alphabetical order? find most occuring character("blablabla") remove most occuring("aaa") input: blablabla output: "aaa" | |
I have a small application written using javascript (NodeJS). How can I run it as an executable file? | |
Hey!!!!I'm looking for the perl to java conversion!!!! Can Someone please help me with the snippet!!!! As soon as possible!! Its very important!!!! my @hosts = get_hosts_ips_bymkt(); for(my $i = 0; $i < scalar(@hosts); $i = $i + 1){ my $ssh_true = eval { Net::SSH::Perl->new($hosts[$i]) }; // # $success = … | |
A palindrome is a phrase that reads the same forwards as it does backwards. For example, “a man, a plan, a canal, Panama,” is a palindrome. Write a program that uses a stack data structure to check for palindromes in each line of a text file. Test your program on … | |
Hi guys so I was playing with some code which would determine the whether a string is a palindrome or not. Its been a mixed bag of results with some palindromes being detected while others aren't. I do apologize to the lack of polish of my comments but I hope … | |
Hi everyone! i'm new to binary trees, and i wanted to write a method to find out how many nodes have bigger values than an integer n!! Any help would be appreciated :) ishi xx | |
I have an assignment doing a constructor that accelerates and brakes the speed of the car (among other non-troublesome things) but when I run the program, the speed stays constant and spits out whatever the original number is rather than raising and lowering by 5 like I want it to. … | |
Hi everyone, I'd like to ask you all to help me with this two questions and I've been faced recently, 1.What would be the algorithm which takes the pointers of two Binary Search Trees roots, if equal returns true if not FALSE. (both BSTs are the same as well as … | |
hello. I need some help in java 1.The program browse the filename of the text file to be counted 2.The contents of the file will be stored to a temporary storage. 3.Identifies if the c source code in a form of text file is physical lines of code, blank lines … | |
Does anyone know about robovm??? It is a platform to make ios apps in java. I need it for a new project I´m working on in a nearshore outsourcing company. | |
In Java, is it possible to have Interface in Inner class? | |
I am testing my Library class and the addItem method is not adding an item to the arraylist import java.util.ArrayList; public class Library { /** * itemList contains the List of all items in the library. */ private ArrayList<Item> itemList = new ArrayList<Item>(); Item item = new Item(); // Empty … | |
# I want to give a button in my JSP page, which on click of it should store an image in the filesystem. # Following is the code ScreenCapture.java which is a servlet. Purpose: To capture the screen of working area and store it in file system. Problem: - An … | |
Hi, I have a problem, because I have a list, in which I'd like to be able to add and remove components, but in other thread I use components from this list. Is there a safe way to operate over this list? Would using synchronized functions (one for drawing, one … | |
Why much time is needed to access an applet having swing components the first time? | |
I'm new to Java and I'm trying to recreate a simplified version of the Game of Mastermind. I managed to allow the player to input once but then it stops. I don't know how to fix this, I've tried everything I knew how to do to fix this but I … | |
# Lab Assignment # We must create a program that will print a sorted list of all the students and the corresponding scores listing the highest score first and the lowest score last. In this case I would need a Bubble Sort. ## Question ## This is my "Bubble Sort" … | |
I do the class but there are some codes I need to help me please : -Write a number of member functions that do the following: •Calculate the student GPA •Search for the highest mark taken in a particular course •Print the ID, first name, and last name of all … | |
Hi, I have the program, which is a traffic simulation, and I have a few linked lists in it. I'd like to ask you what is the easiest way to check if I don't have duplicats in them? The code which runs it looks like that: public static void main(String[] … | |
The facts: We are talking about a small company (5 persons) with many clients that making real money (we don't) . We provide our own software that has unique features against the e-commerce completion. The problem: the first glimpse of the problem arose around 2012 and made clear around 2014 … | |
# Lab Question# We must create a program that do the following: Allow the user to type in a student name the coorosponds with the student's exam score. The program will be able to accpet exam scores till the user types in the phrase "allDone". The code will determine which … | |
I am in a Computer Science Class and need help with the following Lab Assingment (WARNIG: this entry may be unintentionally long): # Lab Question # We must create a program that will do these three things: (1) Allow the user to type in a student name the coorosponds with … | |
Hi, something weird happened with my program, I mean when I run it I see only grey frame (like I had only JFrame object in my app), then I minimalize application, maximalize it and only then I see all components painted (JButton, rectangels and lines inside Jpanel,...). Changing of frame … | |
First how this happened. The Nissan Leaf from about 2011 to mid 2015 on the SV and SL models included Telematics. Telematics in thse models let the owner use a web site or smart phone app to query battery status, start or stop charging and turn on/off the climate control … |
The End.