Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

How do I convert a stringbuffer into a double in Java?
(calculating Sales) an online retailer sells five products whose retail prices are as follows:
Product 1, $2.98; product 2, $4.50, product 3, $9.98; product 4, $4.49 and product 5, $6.87.
Write an application tht reads a series of numbers as follows:
a) product number
b) quantatity sold

Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the program should stop looping and display the final results.
Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "The number is a palindrome." If it is not then print "The number is not a palindrome"
We have to use an Array
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Scanner;

import javax.swing.JFrame;

import acm.graphics.GCanvas;
import acm.graphics.GRect;

/**

public class GRectDemo {

static final int BAR_WIDTH = 40;


public static void main(String[] args) {

// Start by building the rectangle

GRect bar = new GRect(0,460, BAR_WIDTH, 8);
bar.setColor(Color.DARK_GRAY);
bar.setFilled(true);

// Then build a canvas to hold the rectangle

GCanvas gc = new GCanvas();
gc.setPreferredSize(new Dimension(BAR_WIDTH, 40));

gc.add(bar);
why does rectangle flip to top of screen?
Building a GRect program in java, it creates rectangle and then allows user to enter a new height of the rectangle. When the program runs the rectangle starts at the bottom left of the screen which it should but when user enters new height the program flips the rectangle to the top of screen and the rectangle grows down the screen, any help?
Problem Description:
1. Prompt the user to enter a whole number from 1 to 9 inclusive. The number zero (0) will be used
to exit the application. If any other number is entered, then an error message shall be displayed
and then the prompt to enter a whole number will be re-displayed.
2. Create a pyramid structure by using only the odd numbers without going over the number entered
in by the user. For example:
If the user entered in 8, then construct your pyramid using the numbers 1, 3, 5, and 7.
3. The pyramid shall be constructing by repeating the odd number the same number of times as its
value. For example:
The number 1 will be repeated only once.
The number 3 will be repeated three times.
The number 5 will be repeated five times.
4. The pyramid shall be centered accordingly, with the highest odd number being the most left align.
This will require you to calculate the center of the pyramid based upon the highest odd number.
The number one (1) will always be in the center
prompts the user to enter 10 integers from 0 to 100. Keep these numbers in an array of integers named yourNumber[]. From this array, calculate and display the sum of all these 10 numbers. Next, identify and display the largest and the smallest number. Finally, provide the number of integers in this array which are odd numbers. Take note that all input from user will be handled by the input dialog method from JOptionPane class and all repetitive tasks must be executed using for or while loops.
print a heart...using asterix(*) ......in java
what is the standard location in my project folder for text file to be store so that it will be read after making the program's executable jar file. pls help that will be appreciable.
Thanks
http://pastebin.com/BH4hwmPE
My code can't compile.It gives a "recompile with -xlint:unchecked for details" error message when i try to compile it in bluej.
LATEST TUTORIALS
APPROVED BY CLIENTS