Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am working on my rectanglar calculator in Java. I was comparing my code mport java.util.Scanner; public class RectangleCalculator { public static void main (

I am working on my rectanglar calculator in Java. I was comparing my code mport java.util.Scanner;
public class RectangleCalculator {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("Welcome to the Area and Perimeter Calculator");
boolean continueCalculations = true;
while (continueCalculations){
System.out.print("Enter length: ");
double length = input.nextDouble();
System.out.print("Enter width: ");
double width = input.nextDouble();
double area = width * length;
double perimeter =2* width +2* length;
System.out.println("Area: "+ area);
System.out.println("Perimeter: "+ perimeter);
System.out.print("Continue?(y/n): ");
String userChoice = input.next();
continueCalculations = userChoice.equalsIgnoreCase("y");
}
}
}with the example given and the example is also incorrect, please help???

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago

Question

Explain the need for and importance of co-ordination?

Answered: 1 week ago

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

Question Can I collect benefits if I become disabled?

Answered: 1 week ago

Question

Question May I set up a Keogh plan in addition to an IRA?

Answered: 1 week ago