Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

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 & Filtering

How to read an input file line by line and scramble each word on that line. Once those words are scrambled you must print the line out with the words in the original order (but scrambled) to an output file. This process repeats for each line of the input file.

With each line from the input file you will also print the original words from that line to the screen but sorted by their length rather than alphabetical order.

Do not use ArrayList
Do not use .asList()
Do not use anything that is called like: Collections.someMethod()

Use String .split(" ") that is built into String
Use String .toCharArray() that is built into String
Use Random .nextInt()
Use .nextInt()

You must write the loop that shuffles the letters of the String by calling .nextInt(
modulus)
And swapping letters.
The class has the following contructors and methods:

* A default constructor that sets the rational numbers to 0/1
* A constructor that has parameters for the numerator and denominator and converts the resulting ratio to simplified form.
* simplify--a private method that converts the rational numbers to simplified form.
* geGCD (x, y )--a private static method that returns the largest common factor of the two positive integers x and y, that is, their greatest common divisor. For example, the greatest common divisor of 40 and 12 is 4.
* getValue--returns the rational number as a double value.
* toString--returns the rational number as a string in the form a/b.
Write a program that calculates the Total Price of value meal ordered. The Total Price must include the 8% Government tax. Get inputs from user, the type of value meal selected and the quantity ordered. Use if-else statement. Hints Gov tax = 0.08 x Price and Total Price = (Price x quantity) + Government Tax
Write a Java program that reads a sequence of 10 integers. The program should find the number of even integers, their sum, and the maximum even value.
Write a Java program that translates a number between 0 and 4 into the closest letter grade according to the shown below Kuwait University Guidelines. For example, the number 2.6 would be converted to C+. Break ties in favor of the better grade (i.e. 2.67 should be a B-).
Write a Java program that reads from the user an integer N followed by N integers. The program then prints the product of odd integers, and, the sum of even integers.
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.
LATEST TUTORIALS
APPROVED BY CLIENTS