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

An online retailer sells five products whose retail prices are as follows:

Product 1, $2.98
Product 2, $4.50
Product 3, $3.98
Product 4, $4.49
Product 5, $6.87

Write an application that reads (from the keyboard) a series of pairs of numbers as follows:
product number
quantity sold
Run your program from a simple menu with the following options
Enter products sold
Display total retail value
Exit
Your program should
allow for entry of multiple products without returning to the main menu (use a sentinel-controlled loop)
use a switch statement to determine the retail price for each product
calculate and display the total retail value of all products sold
In java write a program that does the following: design a class account that contains a private int data field named Id for the account (default=0). A private double data field named balance for the account default 0. A private double data field named annualIntrestRate that stores the current interest rate default 0. A private date field named dateCreated that stores the date when the account was created. A no-art constructor that creates a default account. A constructor that creates an account with specified Id and initial balance. The accessor and mutator methods for id, balance, and annualIntrestRate. The accessor method for dateCreated. A method named getMonthlyIntrestRate() that returns the monthly interest rate. A method named getMothlyIntrest that returns the monthly interest rate. A method named withdraw that withdraws a specified amount from the account. A method named deposit that deposits a specified amount into the account.
in java write a program that does the following. design a class named MyInteger the class contains...
an int data field named value that stores the int value represented by this object
a constructor that creates a MyInteger object for the specified int value
a get method that returns the int value
the methods isEven(), isOdd(), and isPrime() that return true if the value of the object is even, odd or prime, respectively.
The static methods isEven(int), isOdd(int), and isPrime(int) that return true if the specified value is even, odd, or prime, respectively.
The static method isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively.
The methods equals(int) and equals(MyInteger) that return true if the value in this object is equal to the specified value.
A static method parseInt(char[]) that converts an array of numeric characters to an int value.
A static method parseInt(String) that converts a string into an int value.
(Temperature Class) Create a class called Temperature that is used to convert temperatures from/to Celsius/Fahrenheit. Temperature should include one instance variable— temperature degree (type double). Your class should have a constructor that initializes instance variable. Provide set and get methods for it. In addition, provide the following two methods
 toCelsius() that converts and returns the temperature degree in Celsius.
 toFahrenheit()that converts and returns the temperature degree in Fahrenheit.
Write a test application named TemperatureTest that demonstrate the following sample output using Temperature class.
Hi, i am pretty much a beginner programmer. I need to list out array items according to their max value down. It is a movie list where i need to list the movies according to the amount of views. I can calculate the one movie that has the most views with the following code.
public void mostWatchedMovies(Movie [] mList)
{
String print = "";
int watched = 0, mostWatched = 0;
for (int i = 0; i < total; i++)
{
watched = mList[i].getWatched();
if(watched>mostWatched)
{
mostWatched = watched;
}
print = "Most watched is "+mList[i].getTitle()+" watched "+mostWatched+" times";
}
JOptionPane.showMessageDialog(null, print);
}

The array is called mList, the getTitle and the getWatched are simply returning movie title and amount of views from a movie class.This works fine. I'm completely unfamiliar with arraylist and its sort methods so i want to do this with a normal array of movie objects. Could i use this most watched calculated in maybe for loop to countdown from most watched
write a Java program that sorts a sequence of numbers using two different algorithms: insertInOrder and bubbleSort.

input file 1 - 12 23 5 17 6 19 13 3 41 21 11 22 30 31 16
input file 2 - 58 120 121 69 138 171 36 175 31 115 104 22
Write an algorithm that is given your electric meter readings (in kilowatt-hours) at the beginning and end of each month of the year. The algorithm determines your annual cost of electricity on the basis of a charge of 6 cents per kilowatt-hour for the first 1,000 kilowatt-hours of each month and 8 cents per kilowatt-hour beyond 1,000. After printing out your total annual charge, the algorithm also determines whether you used less than 500 kilowatt- hours for the entire year and, if so, prints out a message thanking you for conserving electricity.
Can you guys plss help me on this problem,..I nid it A.S.A.P.


2.1.Make a program that allows you to create a 3 X 4 integer array. Your program will initialize the array with random numbers from 0 to 1000. Your program also will identify and display the largest value, smallest value, sum and average value of all data in the array.
Hello, i have a question about java programming. Please help anyone..this is going to be on my test tomorrow.?

this is what i am using as my input file.
1) 67 23 49 27 51 57 55 12 10 3

2) 13 98 14 72 73 81 64 53 2 21 33 19 35 26 1

3) 99 88 77 66 55 44 33 22 11 12 23 34 45 56 67 78 89 91 21 32




private static void printArray( int array[], int cnt ); // print all values in the array on one line with a space after each number
private static void printAllBelow( int array[], int cnt, double ave ); // print all values that are less than the aveerage on one line
private static void printAllAbove( int array[], int cnt, double ave ); // print all values that are greater than the average on one line
private static int findMin( int array[], int cnt ) // return the smallest int in the array
private static int findMax( int array[], int cnt ) // return the largest
private static double findAve( int array[], int cnt ) // return the average

i know that to print all values of an array goes like this,

for( int i = 0; i< myArray.length; i++)
System.out.println( myArray[i]);
System.out.print(a
Write Java programs for each of the following. Compile, run and verify each
program. Appropriate comments, indentation and identifier names are expected.
1. Acoustic foam is a material used for sound insulation. It is manufactured by
pouring a latex-like material into a mold (similar to a waffle iron). Write a java
program which computes the volume of liguid
required to generate a sheet of this material.
Notice that a sheet has a base, (which you can
assume is 3cm thick), and a rectangular grid of
4-sided pyramids. Your program should input
the dimensions of the grid (pyramids across by
pyramids down), as well as the depth and width
of a pyramid. You can assume that the base of
each pyramid is a square and that all pyramids
on a sheet are of the same size. You can also
assume that there is no expansion or contraction
during the curing process.
LATEST TUTORIALS
APPROVED BY CLIENTS