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
igor_vitrenko [27]
2 years ago
9

How to write an algorithm to find area and perimeter of diamond .​

Computers and Technology
1 answer:
Roman55 [17]2 years ago
3 0
Find the area of both triangles with 1/2•base•height then add them together
You might be interested in
Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
Rashid [163]

Answer:

The code written in python and fully commented for this question is given below:

# Create the function shampoo_instructions with the num_cycles parameter input

def shampoo_instructions(num_cycles):

   # Condition if is less than 1, print too few

   if num_cycles < 1:

       print("Too few.")

   # Condition if is greater than 4, print too many

   elif num_cycles > 4:

       print("Too many.")

   # If is in inclusive range [1,4], print the Lather and rinse cycle

   else:

       # Create a for loop to print rinse cycle

       for i in range(num_cycles):

           print("{}: Lather and rinse.".format(i+1))

   # Print an end string for each execution

   print("End-------------------------------------")

# Call the function with all the conditions tested

shampoo_instructions(3)

shampoo_instructions(0)

shampoo_instructions(4)

shampoo_instructions(5)

Explanation:

I attach an image that contains the output of the execution and the source code.

3 0
3 years ago
Why is an ISA unlikely to change between successive generations of microarchitectures
QveST [7]
Someone answer this because I need to know as well
\
4 0
3 years ago
Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
Drupady [299]

#include <iostream>

using namespace std;

class CarCounter {

  public:

     CarCounter();

     CarCounter(const CarCounter& origCarCounter);

     void SetCarCount(const int count) {

         carCount = count;

     }

     int GetCarCount() const {

         return carCount;

     }

  private:

     int carCount;

};

CarCounter::CarCounter() {

  carCount = 0;

  return;

}

CarCounter::CarCounter(const CarCounter &p){

carCount = p.carCount;

}

void CountPrinter(CarCounter carCntr) {

  cout << "Cars counted: " << carCntr.GetCarCount();

  return;

}

int main() {

  CarCounter parkingLot;

  parkingLot.SetCarCount(5);

  CountPrinter(parkingLot);

  return 0;

}

Sample output:  

Cars Counted: 5

8 0
3 years ago
Read 2 more answers
Compare and contrast the TwoFish encryption algorithm with the DES and AES algorithms. In your comparison be sure to compare and
zheka24 [161]

Answer:

The comparison is done based on their basic, principle, plaintext, key size, rounds, rounds name, security and speed. See the attached document.

Explanation:

The the attachment

8 0
4 years ago
Which part of a window lets you see a fileâs contents without opening the file?
Artyom0805 [142]
The preview pane. On the right hand side of the file explorer.
3 0
3 years ago
Other questions:
  • Q3** Write a query to create a new price list for books written by the same author. Allow the user to enter only the first 4 let
    15·1 answer
  • What is a computer??????????????????????????????????????????????????????????
    12·2 answers
  • The maximum number of colors that should be used on a slide is _____. 2 4 6 8
    5·1 answer
  • Which of these options would likely have a better playback experience in your presentation?
    8·2 answers
  • . ------------ means that the two merging companiesbecame history and a new firm
    10·1 answer
  • Match the desired outcome to the appropriate action.
    6·1 answer
  • 1. What are you going to do if someone ask for your personal information online?​
    12·2 answers
  • 19. Fatigue can help improve your reaction time.<br> False<br> O True
    8·2 answers
  • Which of the following statements about recommendation engines is TRUE?A: An online recommendation engine is a set of algorithms
    10·1 answer
  • Who invented the first mechanical computer? in what year was it invented?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!