1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Illusion [34]
3 years ago
12

In order to paint a wall that has a number of windows, we want to know its area. Each window has a size of 2 ft by 3 ft. Write a

program that reads the width and height of the wall and the number of windows,.
Computers and Technology
2 answers:
Oksana_A [137]3 years ago
5 0

Answer:

The program in Java will be:

import java.util.Scanner;

public class Paint

{

   public static void main(String[] args)

   {

       final int COVERAGE = 350;  //paint covers 350 sq ft/gal

       final int DOOR = 20;

   final int WINDOW = 15;    

   //declare integers length, width, and height;

   int length, width, height, doors, windows;

   //declare double totalSqFt;

   double totalSqFt;

       //declare double paintNeeded;

   double paintNeeded;

     //declare and initialize Scanner object

   Scanner scan = new Scanner (System.in);

   //Prompt for and read in the length of the room

   // finish this -- length =  

   System.out.print("Enter the length of the room: ");

   length = scan.nextInt();

   //Prompt for and read in the width of the room

       System.out.print("Enter width: ");

   width = scan.nextInt();

       //Prompt for and read in the height of the room

   System.out.print("Enter height: ");

   height = scan.nextInt();

       //Prompt for and enter the number of doors    

   System.out.println("Enter the number of doors: ");

   doors = scan.nextInt();

   //Prompt for and enter the number of windows

   System.out.println("Enter the number of windows: ");

   windows = scan.nextInt();

   //Compute the total square feet to be painted--think

      //about the dimensions of each wall

       totalSqFt = 2 * width * height + 2 * length * height - DOOR*doors - WINDOW*windows;

       //Compute the amount of paint needed

       paintNeeded = totalSqFt / COVERAGE;

       //Print the length, width, and height of the room and the

       //number of gallons of paint needed.

   System.out.println("Length= " + length + "\nWidth= " + width +  "\nHeight= " + height + "\nNumber of doors: " + doors + "\nNumber of windows: " + windows + "\nGallons of Paint Needed= " + paintNeeded);

   

   }

}

Digiron [165]3 years ago
3 0

Answer:

6ft

Explanation:

Step 1:

import java.util.Scanner;

class AreaOfRectangle {

public static void main (String[] args)

{

Scanner scanner = new Scanner(System.in);

System.out.println("Enter the length of Rectangle:");

double length = scanner.nextDouble();

System.out.println("Enter the width of Rectangle:");

double width = scanner.nextDouble();

//Area = length*width;

double area = length*width;

System.out.println("Area of Rectangle is:"+area);

}

}

Output

Enter the length of Rectangle:

2

Enter the width of Rectangle:

3

Area of Rectangle is:6.0

You might be interested in
Help plzzzzzzzzzzzzzzzzzzzzzzzzz
Reil [10]

B, Parallel ports are faster than serial ports.

A parallel port can move a set of 8 bits at a time on eight different wires, it uses a 25 pin connector, called a DB-25 connector, whereas a serial port only has a DB-9 connector.

7 0
3 years ago
What protocol suite below is the most commonly used protocol for local area network (lan) communication?
grandymaker [24]
Answer TCP/IP is the most common protocol in Local Area Networks.
3 0
3 years ago
Favorite video games list atleast 5<br><br> favorite to least
Aneli [31]

Answer:

Rob lox, Sub nautica, Phasmo phobia, Albion Online,  fnf.

Explanation:

6 0
3 years ago
Early personal computer users remember the cumbersome, user-unfriendly DOS system. When Apple introduced System 1 and Microsoft
Furkat [3]

Answer:

Relative Advantage.

Explanation:

Modern computer owners will be reminded of such a slow, user-unfriendly DOS program. Whenever Apple released System 1 as well as Microsoft launched Windows, all among these became far harder to just use, such revolutionary technologies circulated easily owing towards its relative advantage.

So, the following are the reason which describe that answer is correct according to the question.

7 0
3 years ago
Qla
Olenka [21]

Answer:a

What are the activities a Database Designer will do if using the SDLC to design a Database [10]

Q1b

List the five main components of Access Database and state their uses [1

Explanation:

7 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    10·1 answer
  • What phrase best describes the overall structure of the<br> passage
    9·1 answer
  • How to block someone from watching your youtube videos?
    12·2 answers
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • When comparing alternative methods for making information systems identification and selection decisions, top management's selec
    7·1 answer
  • What X coordinate does the center of a game begin at?
    9·1 answer
  • Ciscon Telecom is a mobile operator in the European Union. The company provides personalized services to its customers, and its
    8·2 answers
  • Winners announced tomorrow when I check results ngl I gtg to sleep soon I should see a lot of people tomorrow ^^
    8·1 answer
  • A type of attack where the adversary intercepts network packets, modifies them, and inserts them back into the network is called
    13·1 answer
  • Explain how the number of jobs available to workers has been affected by the use of ICT in commerce and industry, using specific
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!