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
algol [13]
3 years ago
8

Develop a program that will calculate the area and perimeter of a rectangle. The length and width can be given as constant.(LENG

TH= 8 WIDTH=8).
Computers and Technology
1 answer:
o-na [289]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

 

  int length = 8;

  int width = 8;

 

  int perimeter = 2*(length + width);

  int area = length * width;

 

  cout<<"The perimeter is "<<perimeter<<endl;

  cout<<"The area is "<<area<<endl;

 

  return 0;

}

Explanation:

include the library iostream for using the input/output instructions in the c++ programming.

Create the main function and define the variable length and width with values.

Then, use the formula for calculating the perimeter and area of rectangle.

perimeter = 2*(length + width)

area = length * width

and store in the variables and finally print the output.

You might be interested in
What component has the job of managing data as it flows into and out of the places it needs to go?
kompoz [17]
Memory controller. ......
3 0
3 years ago
Read 2 more answers
What is the best operating system
True [87]
#1 Windows
#2 Ubuntu
#3 Mac OS
#4 Fedora
#5 Solaris

Those are the top 5 best operating systems
6 0
4 years ago
Justin has started a lawn mowing business in his neighborhood. He is running a weed-pulling special this month. What is the most
lisov135 [29]
The most efficient way to communicate would be emailing
5 0
4 years ago
Read 2 more answers
Compare the graphs. Find the value of h, k, or a.
Serga [27]

Answer:

dchdchbhdcdc

Explanation:

6 0
3 years ago
Write a program in python to test if given number is prime or not.
Paraphin [41]

Answer:

Answer:

def main():

num = int(input("Input a number to check for prime: "))

if num > 1:

 for i in range(2,num):

  if (num % i) == 0:

   print("%d is not a prime number" % num)

   break

  else:

   print("%d is a prime number" % num)

   break

else:

 print("%d is not a prime number" % num)

 

if __name__ == "__main__":

main()

Explanation:

Solution retrieved from programiz.com.

Note, this program uses the idea of the Sieve of Eratosthenes to validate the input number by using the modulo operator to determine primeness.

The program will output to the user if the number input is indeed prime or not.

Cheers.

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT one of the most important elements when designing a website?
    8·2 answers
  • What is the height of the tallest possible red-black tree containing 31 values?
    7·1 answer
  • The maximum number of colors that should be used on a slide is _____. 2 4 6 8
    5·1 answer
  • What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?
    13·1 answer
  • 次のうち、ビジネスレターに適したフォントとポイントサイズの選択はどれですか?<br> 私を助けてください!私はあなたを最高にブランコにします!
    12·2 answers
  • Which computer company was named after an orchard? dell, apple, or ibm
    11·1 answer
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • What are some examples of what can be changed through options available on the mini toolbar
    5·1 answer
  • 1.printer is an example of......... device.<br><br>​
    11·2 answers
  • Which option on the Format tab is used to modify particular portions of the chart?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!