subject

Make a file called rectangle. java. in this file, create the following methods: //ask the user for the length of the rectangle. public static double getlength(scanner keyboard) //ask the user for the width of the rectangle public static double getwidth(scanner keyboard) //calculate the area of the rectangle public static double getarea(double length, double width) //display the information about the rectangle public static void displaydata(double length, double width).

demo 5 content:

import org. w3c. dom. css. rect;

import java. util. scanner;

public class demo5
{
public static void main(string[] args)
{
scanner keyboard = new scanner(system. in);
double length = rectangle. getlength(keyboard);
double width = rectangle. getwidth(keyboard);
double area = rectangle. getarea(length, width);

system. out. printf("you entered: %.1f, %.1f, and %.1f\n", length, width, area);

rectangle. displaydata(length, width);
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Write a program that reads string that consists of (upper case, lower case, and digits) including white spaces from the keyboard until user enters ‘#’. then, your program should count total number of characters, uppercase letters, lowercase letters, and digits.
Answers: 3
question
Computers and Technology, 22.06.2019 00:40
Write a function 'music_func' that takes 3 parameters -- music type, music group, vocalist -- and prints them all out as shown in the example below. in case no input is provided by the user, the function should assume these values for the parameters: "classic rock", "the beatles", "freddie mercury". for example: input: alternative rock,pearl jam,chris cornell output: the best kind of music is alternative rock the best music group is pearl jam the best lead vocalist is chris cornell note: the print statements will go inside the for example: print("the best kind of music is"
Answers: 2
question
Computers and Technology, 22.06.2019 13:20
You have a router connecting two subnets. a packet is sent from 10.0.0.3 to destination 192.168.0.10. the router's routing table lists the following routes: 10.0.0.0/8 via eth0 10.0.0.0/24 via eth1 192.168.1.0/24 via eth2 0.0.0.0 0.0.0.0 via s0/0 what will happen to this packet? a) the router will send the packet using its default route b) the router will send the packet out eth0 c) the router will send the packet out of eth1 d) the router will send the packet out of eth2
Answers: 3
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
You know the right answer?
Make a file called rectangle. java. in this file, create the following methods: //ask the user for...
Questions
question
Mathematics, 10.12.2019 16:31
question
Social Studies, 10.12.2019 16:31
Questions on the website: 10325352