I am trying to make a program that get input value 1-200 from user. However I would like to make the program to show warning if the input number is not within the range of 1-200. In the end I would like to show the amount of number according to its interval (i.e less 50, 51-100 and so on) ....
import java.util.Scanner; class test { public static void main (String[] args) { int number[]= new int[5]; int number2[]= new int[5]; int a=0,b=0,c=0,d=0,i=0;
I've four classes object. I don't know how to display the amount paid by the user, and show the balance. The calculate button just show the total amount. Do I have to create another object class? And I've to show the bills too.
This is my 1st Frame
import javax.swing.*; import java.awt.*; //titlepanel class displays a title in a panel public class TitlePanel extends JPanel { public TitlePanel() { JLabel title = new JLabel();
Web based program, basically a slide show template where the user uploads a series of photos, they are dumped into the pre-fabbed template of a predetermined set of transitions in sync with music. I will set the templates to transition based on the time stamp of the beat of the music at certain intervals. The end users will be able to then create their own slide show "movie" based on the templates.
Problems I see are the syncing between the music and the images loading. Wondering if it's doable client side or if I need to have it rendered server-side.
I'm having the hardest time getting a program to compile. I'm beginning to think I've downloaded the incorrect version of turtle graphics. This symbol looks foreign and I'm unsure how to find a solution. I have fixed some of the errors since this last picture but I will write out my code. The program takes a photo and converts to gray scale then to sepia
import images.APImages; import images.Pixel; import java.util.Scanner; public class sepia{ public static void main(String [] args){
We have been given an assignment to create a small library, with the following classes Library, Book, Author and Copy. With a given class Biblio which has predefined code and adds the books to the class book in an arraylist in Class Copy.
The UML Domain is attached so you know the flow of the classes Everything is working fine and the generated output is correct.
There is just one method in class Library that is not working, the int method has to count the number of Copy's based on the Class Book (String):
I have to go through the Arraylist in Class Copy and look for a specific book and return the number of copy's.
I have tried multiple steps using a for loop Now I have found a similar post the uses hashset, I have tried below code but the return comes back with 0. (There are 3 copy's)
I was trying to come up with the design for a library. Here are the requirements:
The library maintains a record of books and its members. It allows members to check out books. Books can be searched by author name or title. The books are classified into 4 categories - General, Sports, Politics, Business.
I've come up with this initial design:
Classes:
Category (enum)BookMemberLibrary Category Attributes: SPORTS, GENERAL, POLITICS, BUSINESS Book Attributes: String title, String authorName, Category category, boolean checkedOut
class A { List<StringBuilder> list; public void output(List<StringBuilder> objectToOutput){ try(BufferedWriter bw = new BufferedWriter(new FileWriter("temp.txt"))){ for(StringBuilder row:objectToOutput) bw.write(row.toString()); }catch(IOException e){}
[code]....
Why don't the a's show up on the console? I put them in as part of the debugging process and now I don't understand why they don't show up in both places.
How do i make the 'date' column show only the date and 'timeIn' and 'timeOut' column only show the time. In my database table my 'date' column is a date type and 'timeIn' and 'timeOut' column is time.
I have i am trying to implement tooltip through javascript, like when we click on an image link tooltip should be displayed and it should have close button/ close image to close that tooltip.like the same way i will have multiple images on page, when ever i click on the images all tooltips should be displayed on the page when ever i want to close that then only it should close through close button on tooltip.can we do it through java script or will go for jquery.
I'm very new to Java, and I am creating a program that takes multiple user input to create one face. I have a class for the eyes, nose, lips, and headshape. For some reason, my program is not drawing the graphics. ***for question purposes, I have only included my head shape class and my test class****
my "test" class:
import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; public class FaceTest { public static void main(String[] args) { String head = JOptionPane.showInputDialog("Would you like a circle, square, rectangle shaped head?: ");
Here's the small project... but how can I return the value (amount) in 10 years ? The way I did, the program just doesnt return anything...
import java.util.Scanner; public class FutureValue { public static void main (String []args) { double amount = 0; double apr = 0; System.out.println("How much money would you like to invest?");
I am having is not being able to print out the diamond the amount of times the user enters (for example, when it asks how many diamonds, I enter a 2 and only one diamond comes out.)
import java.util.Scanner; public class Pattern5 { public static void main(String[] args) { // For this pattern program, ask the user how many diamonds // she would like to print to the screen. The following pattern is one diamond.
Ii am trying run a do while loop on java a specific amount of times for example if i were to type in "Enter number of years" and enter 4. i need the loop to execute 4 times or if i said 6 times then i would be 6. the program i have repeats it and takes it back to reentering "Enter number of years" i need it to execute by its self x amount of times. here is what i have so far
System.out.println("Enter the number of years: "); years = keyboard.nextInt(); rainfall = generator.nextInt(10) + 1; System.out.println("Year " + "rainfall amounts were");; for (int months = 1; months <= 12; months++)
public static void main(String[] args) { boolean t=false; long cuTime = System.currentTimeMillis() while(t==false) { System.out.println(cuTime); long g=cuTime+2000;
[Code] ....
I tried this and it includes a while loop as the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop
public static void main(String[] args) { boolean t=false; long cuTime = System.currentTimeMillis(); while(t==false) { System.out.println(cuTime); long g=cuTime+2000;
[Code] ....
I tried this and it includes a while loop. therefor the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop...
I am trying to make a program to multiplies two numbers without using the "*" operator. My idea was to add x number y amount of times, which is the same as multiplication. I did this with a for loop, but zero is always returned as the answer. How can I fix this?
public class secondMult { public static void main(String[] args){ System.out.println(multWithSum(4,5)); } public static int multWithSum(int x, int y){ int sum = 0; for(int i = 0; i==y;i++){ sum = sum + x; } return sum; } }
public static void main(String[] args) { boolean t=false; long cuTime = System.currentTimeMillis(); while(t==false) { System.out.println(cuTime);
[code].....
I tried this and it includes a while loop as the whole program has to wait until this while loop executes. So the entire program slows down. Is there any way to do this without a while loop
I have to write some code to take names from the user and then order them in alphabetical order and then print them out which i have managed to do. However, i can't get it to count the characters in the names that the user enters or count the amount of vowels in the names.
This is the code ive written:
import javax.swing.JOptionPane; import java.util.Arrays; String[] names = new String[9]; int i; names[0] = JOptionPane.showInputDialog("Please enter a name"); names[1] = JOptionPane.showInputDialog("Please enter a name");
gather sales amount for the week display the total of sales display the average of sale display the highest sale amount display the lowest sale amount
using occurrences determine how many times the amount occurred for the week
make a sales main make a sales data
This is what i have so far but I'm confused on how to start the occurrence and where it would be placed in order to get the information from the array
public class SalesData { private double[] sales; // The sales data /** The constructor copies the elements in an array to the sales array. @param s The array to copy. */ public SalesData(double[] s) {
I have a question about how to delete only a certain amount of objects on screen in a graphics window. I have a method that will enable me to get rid of every object of the same type off screen, for example this method:
Java Code:
public void deleteTrees() { //clears all tree trunks and leaves for (Iterator<GRect> it = historyT.iterator(); it.hasNext();) { GObject gobj = it.next(); this.remove(gobj);
[Code] ....
That Will delete all trees.
Now In my main method I populate the screen with trees by doing this
My question is how to specify only deleting x amount of trees instead of the whole thing. I pretty sure I need to use something like history.remove(trunk) and to iterate through the amount of trees specified, but not sure how to implement that.
I'm doing this project in JSP.net, with html. and in one of the web pages, what I'm doing is that, a person is transferring an amount to someone else, and if the transfer amount is more than the account balance, then he cannot transfer. else, save details in a table.
Here's the code I've used
<% String t1=request.getParameter("text1"); String t2=request.getParameter("text2"); java.util.Date date1 = new java.util.Date(); SimpleDateFormat ft = new SimpleDateFormat ("dd/MM/yyyy"); int tamt = Integer.parseInt(t2); int bamt = 0;
[Code] .....
But when i enter the fields and click the submit button in the form, to save it in the table, i get the error: