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

The manager of Pizza Palace wants a program that calculates and displays the number of slices of pizza into which a circular pizza can be divided. The manager will enter the radius of the entire pizza. For this problem, use 14.13 as the area of a pizza slice, and use 3.14 as the value of pi. Write a Java program to help the manager of Pizza Palace
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 that reads a series of
pairs of numbers as follows:
a) product number
b) quantity 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.
1.Write a code fragment that prints the contents of a two-dimensional boolean array, using * to represent true and a space to represent false. Include row and
column numbers.package homework;
2.What values does the following code put in the array a [] ?
int N = 10;
int[] a = new int[N];
a[0] = 1;
a[l] = 1;
for (int i = 2; i < N; i++)
a[i] = a[i-l] + a[i-2];
3.Write a static method max3 () that takes three int values as arguments and returns the value of the largest one.Add an overloaded function that does the same thing with three double values.
Write a method multiply() that takes two square matrices of the same
dimensionasarguments andproduces their product(another square matrix ofthat
samedimension). Extra credit: Make your program work wheneverthe number of
rows in the first matrix is equalto the number of columns in the second matrix.
* Write a method any() that takes an arrayof bool ean values as argument
and returns true if any of the entries in the array is true, and fal se otherwise.
Write a method all() that takes an array of bool ean values as argument and re
turns true if allof the entries in the arrayaretrue, and fal se otherwise.
/everytime i run this program it shows my answer is incorrect. Please show me my problem


import java.util.Scanner;

public class Exercise04_22 {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);

System.out.print("Enter string s1: ");
String string1 = input.next();

System.out.print("Enter string s2: ");
String string2 = input.next();

boolean retVal;
retVal = string1.equals(string2);

if (retVal = true) {
// Returns -1 if not matched.

System.out.println(string2 + " is a substring of " + string1);
} else {
System.out.println(string2 + " is not a substring of " + string1);
}
}
}
How to write a program for calculator in java without using swing?
I want a code for calculator program in java. For example 9+2-5*8/3. I want a final answer for this.
Like for the whole expression i want the final answer sir.
1.What is a framework?
2.What is singleton class?
Take input for boarding place,arriving place and date
Date validation for 120 days(if date is more than 120 days you are not able to book the ticket).if days are less than 120 days then ask for the count of passengers
Take passengers age and gender
If age is less than 13 you have to pay half of the price of the ticket.And if age is greater than 59 you have to pay 60% of the ticket price
Then display final amount of the ticket,date,passengers(male,female and child count with age),ticket booking confirmation message
How Java is secure?
LATEST TUTORIALS
APPROVED BY CLIENTS