pls answer these question

pls answer these question

Write a program that prompts the user to input the length and width of a rectangle. Then calculate and prints the rectangle‚??s area and perimeter.

View Answers

August 23, 2011 at 11:58 AM

import java.io.*;
class rectangle{
    public static void main(String[] args)throws Exception{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Enter Length: ");
        int l=Integer.parseInt(br.readLine());
        System.out.print("Enter Width: ");
        int b=Integer.parseInt(br.readLine());
        int area=l*b;
        int perimeter=(2*l)+(2*b);
        System.out.println("Area of Rectangle: "+area);
        System.out.println("Perimeter of Rectangle: "+perimeter);
    }
}









Related Tutorials/Questions & Answers:
pls answer these question
pls answer these question  Write a program that prompts the user to input the length and width of a rectangle. Then calculate and prints the rectangle‚??s area and perimeter.   import java.io.*; class rectangle
pls answer the Trangle pattern
pls answer the Trangle pattern    a b c d e b c d e c d e d e e Please answer and give the code for above triangle
Advertisements
pls answer - Security
pls answer  what are the difference of open source dbms and proprietary dbms
pls help me with this question
pls help me with this question  how to write a program in C++ using encapsulation,polymorphism,inheritance and abstraction?(all these concepts should come in a single program
share your answer to this question
share your answer to this question  i need to know what is the TELERIK CONTROL? what is the map suite? what is dunda chart? Also i have to know what are the websites available which give infor regarding this. Let me know how
java interview question and answer - Java Interview Questions
java interview question and answer   sir, i want one mark java interview question and answers
pls give me answer ae soon as possible - Ajax
pls give me answer ae soon as possible  i m writing code of ajax technology ...but it is not working pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
i cNT GET ANSWER FOR THIS QUESTION
i cNT GET ANSWER FOR THIS QUESTION  The roots of the quadratic equation ax2+bx+c=0, a√Į‚??¬Ļ0 are given by the following formula: x=(-b√?¬Ī√Ęň?Ň°(b^2-4ac))/2a In this formula. The term b2-4ac is called
Please , can any one answer this Question?
Please , can any one answer this Question?  How to cummunicate one web application to another web application in different places
Clarify my last question's answer - Java Beginners
Clarify my last question's answer  Dear expert, I've tried out... did not specify my question too clearly. Here's my 2 database... question. Do you want to search through id or through the qualification selected
Java experts.Please answer this question - Java Beginners
Java experts.Please answer this question  class A { void get() { System.out.println("A's method"); } } class C extends A{} class D extends A { void set() { System.out.println("D's method"); } } class ins { public
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program that prompts the user to input an integer and the output the number with the digits reversed. For example if the input is 12345, the output should be 54321
i need to answer this Question but i can't do it probably
i need to answer this Question but i can't do it probably   use the web to locate the lyrics to the traditional song"The Twelve Days of Christmas" the song contains a list of gifts received for the holiday.the list is cumulative
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  Write a java program that reads the following information and prints a payroll statement: Employee‚??s name (e.g: Sam) Number of hours worked in a week (e.g: 10
hi... pls give me the example of java coding for following question
hi... pls give me the example of java coding for following question   Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest
hi,i'am new to Jsp.Can some one please let me know an answer for this question?
hi,i'am new to Jsp.Can some one please let me know an answer for this question?  how do we upload an xml file and validate them against WIPO DTD
Question Answer
. If proper answer is not given you can ask question detailing about the previous... Question-Answer Guidelines... Here, you can post your desired question. For posting any question / query
question
question  pls ans me starting point of the jsp
send answer
send answer  For online exam project,i want single question on single page and on that page there are three buttons previous,submit,next.If i click on next button it show next question from database
answer it soon
answer it soon  write a proggram to accept a number and check whether the sum of prime factors of a number is a prime number
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question-Answer Guidelines
Question-Answer Guidelines How to ask questions... of the question if the answer is too long to response. This process has been adopted... Latest Questions Question-Answer Guidelines
Question
Question   When there is an exception in my program how java runtime system handles
answer
java.please answer this...
java.please answer this...   Q1).How we can write a complete JAVA program that computes the following summation formulas..? ‚??_(i=1)^n‚??„??i^2=„?? (n^(2 ) „??(n+1)„??^2)/4
struts interview Question - Struts
struts interview question and answer java  struts interview question and answer java
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
ModuleNotFoundError: No module named 'pls'
ModuleNotFoundError: No module named 'pls'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pls' How to remove the ModuleNotFoundError: No module named 'pls' error
ModuleNotFoundError: No module named 'pls'
ModuleNotFoundError: No module named 'pls'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pls' How to remove the ModuleNotFoundError: No module named 'pls' error
ModuleNotFoundError: No module named 'pls'
ModuleNotFoundError: No module named 'pls'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pls' How to remove the ModuleNotFoundError: No module named 'pls' error
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
Core Java Interview Question Page 3
Core Java Interview Question Page 3       Question: When you declare a method as abstract method ? Answer: When i want child class to implement the behavior
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
pls help me it urgent
pls help me it urgent  hey, pls help me i want to know that can we call java/.bat file from plsql/proceudre /trigger
Pls anyboby tell me...
Pls anyboby tell me...  which book easy to learn spring
on-line examination project?(urgent pls)
on-line examination project?(urgent pls)  Hello friends, i am doing an on-line examination project. In A page i will get n(user requirement) questions from data base(question and five radio buttons) if the user had
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
Pls send code
Pls send code   I am Mohini Charankar suppose Name="Mohini" Edit Button Click on that I change my Name with "Mohini/" Save it and page refresh After... an error pls send code
pls send code
pls send code   pls send code for set database value into text box based on selected value in struts and jsp   use any database and get its code for getting values from google
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Pls help me with strings
Pls help me with strings  To reverse a every other word in a string. Example :- If the input is "This is a line of message" the output should be "sihT is a line fo message
Please answer me - JSP-Servlet
Please answer me  Hello Guys, this is the third time I'm sending this question. But I've not got the right answer from you. The again is: I need java servlet or jsp codes that I can use to insert and retrieve image from MSSQL
Ask JDBC question online
of Roseindia, we are pleased to inform you that we have just begun a new question-answer service ‘Ask Question in JDBC’ for all our visitors. Now you...Ask JDBC question online  †
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'  Hi, My Python... 'answer' How to remove the ModuleNotFoundError: No module named 'answer'... to install padas library. You can install answer python with following command
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'  Hi, My Python... 'answer' How to remove the ModuleNotFoundError: No module named 'answer'... to install padas library. You can install answer python with following command

Ads