Define a function perimeter(base, height) that returns the perimeter of a rectangle with side lengths base and height

Answers

Answer 1

Answer:

int perimeter(base,height)

{

int perimeter_of_rectangle;

perimeter_of_rectangle= 2(base+height);

return (perimeter_of_rectangle);

}

Explanation:

Lets name the function perimeter. It has two parameters base and height.

The function will have return type. In this case I am taking int but it can be float as well.

The function would be:

int perimeter(base,height)

{

int perimeter_of_rectangle;

perimeter_of_rectangle= 2(base+height);

return (perimeter_of_rectangle);

}


Related Questions

Imagine that a team of scientists test a certain hypothesis, and the experimental results show that it is false.

Answers

Answer:

They would have had to retry and go back to experimenting.

Write a program that will read in id numbers and place them in an array.The array is dynamically allocated large enough to hold the number of id numbers given by the user. The program will then input an id and call a function to search for that id in the array. It will print whether the id is in the array or not.

Answers

Answer:

#include <stdio.h>

#include <stdlib.h>

int main() {

  int n, i, *p, s;

  scanf("%d", n);

  p = (int*) malloc(n * sizeof(int));

  if(p == NULL) {

     printf("\nError! memory not allocated.");

     exit(0);

  }

  printf("\nEnter elements of array : ");

  for(i = 0; i < n; ++i) {

     scanf("%d", p + i);  

  }

  scanf("Enter Id to be searched: %d", s);

  for(j = 0; j < n; ++j) {

     if (s == *(p+j)){

         printf("ID number is in the array at position %d", j);

     }else{

         printf("Error: ID number does not exist.");

     }  

  }

  return 0;

Explanation:

The C program source code inputs integer values to dynamic array size, and the search variable is looked for in the array using a for loop. If the search term exists, then the index position is printed on the screen, else an error message is displayed on the screen.


What should be done to make sure the AutoSum feature will use the correct range?
-Click the AutoSum button, and then click the green check mark in the formula bar.
-Select the cell at the beginning of the range, and then right-click the AutoSum button.
-Add spaces between the cells in the range, and then click the AutoSum button.
-Select the cell at the end of the range, and then click the AutoSum button.

Answers

Answer:

Its D

Explanation:

You purchased a copy of a computer game “Plants vs. Zombie”. Then you follow the directions on the package how to install the game. This game is consist of

Answers

Answer:

Please explain what you mean by this.

Explanation:

Describe the Pointer with example?​

Answers

Answer:

A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable.

Answer: A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, the pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however, an integer pointer holds the address of an integer variable.

Explanation:

WHAT DOES THE JEFFY SAY?

Answers

Hi and higaggahahahhaah

Answer:

Jeffy overhears Mario use the word and begins saying f. Mario scolds Jeffy and tells him to not say the word, but Jeffy resumes using it regardless.

Explanation:

Which view in the View tab of the ribbon is the easiest place to add a header or a footer? Normal view Custom Views Page Layout view Page Break Preview

Answers

Answer:

Page Layout view

Explanation:

Answer:

C. Page layout view

Explanation:

Which of the following is the strongest password?
O A. ttwEwtcaoaSm
O B. Thisismypassword
O C. 12345654321
O D. 8)oscysbydel%2

Answers

Answer:

Probably D

Explanation:

In what I have learned, I was taught that a strong password needs all of the following: Lowercase letters, Uppercase letters, Numbers, and Symbols, but the only one that has almost all of these, is D, because it has 2 numbers, 10 lowercase letters, and 1 symbol, the rest are just too obvious, (except for A)       -_-

But other than that, I hope this is right, but if it is not i am very very sorry! :(

The strongest password is ttwEwtcaoaSm. The correct option is A.

What is a password?

A password is a secret string of characters or symbols that is used to prove identity or gain access to a resource or computer system.

Passwords are used to safeguard sensitive data such as personal information, financial information, and online accounts.

A strong password is a difficult-to-guess or crack combination of letters, numbers, and symbols.

To maintain security, it is recommended that you use unique and complex passwords for each account and change them on a regular basis.

The strongest password is ttwEwtcaoaSm, which combines upper and lowercase letters, numbers, and special characters and is not a common phrase or word.

Thus, the correct option is A.

For more details regarding password, visit:

https://brainly.com/question/28114889

#SPJ7

Write a printAllBooks function to display the contents of your library. This function should:

Have two parameters in this order:
array books: array of Bookobjects.
int: number of books in the array (Note: this value might be less than the capacity of 50 books)
This function does notreturn anything
If the number of books is 0 or less than 0, print "No books are stored"
Otherwise, print "Here is a list of books" and then each book in a new line

Answers

Answer:

void printAllBooks(Book [] listOfBooks, int numberOfBooks){

   bool flag = false;

   if(numberOfBooks == 0){

       cout<< "No books are stored";

   } else{

       cout<< "Here is a list of the books \n";

       for (int i =0; i < numberOfBooks; ++i){

           cout<< listOfBooks[i];

       }

   }

}

Explanation:

The void keyword in the "printAllBooks" function is used for a function that has no return statement. The function accepts two parameters, "listOfBooks" which is the array of book objects, and "numberOfBooks" which is the size of the array of objects. The function uses a for loop statement to print out the book in the array if the numberOfBooks variable is greater than zero.

What did networks of the 1960s use to connect computers?

telephone lines

wireless technology

television signals

telegraph cables

Answers

Answer:

id say telephone lines or cables

The answer is Telephone lines

When it comes to cyberbullying, “power imbalance” is the term used for

Answers

Answer:

no

Explanation:

because

Answer:

intimidating someone online with threats

Explanation:

Just did the quiz on edg

Most IT security threats originate with hackers.
Question 3 options:
True
False

Answers

The answer is True they do originate with hackers

In a flowchart of a function, the starting terminal symbol states the name of the function, along with any ________ that the function has.

Answers

Answer:

Parameters.

Explanation:

A flowchart can be defined as a graphical representation of an algorithm for a process or workflow.

Basically, a flowchart make use of standard symbols such as arrows, rectangle, diamond and an oval to graphically represent the steps associated with a system, process or workflow sequentially i.e from the beginning (start) to the end (finish).

In a flowchart of a function, the starting terminal symbol states the name of the function, along with any parameters that the function has.

Define a function hyp(leg1, leg2) that returns the length of the hypotenuse of a right triangle
Hint: number**0.5 takes the square root of a number, number**2 squares a number

Answers

I've included my code in the picture below. Best of luck.

what feature is available to add a suggestion in the margin of someone else's document?​

Answers

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct question is:

what feature is available to add a suggestion in the margin of someone else's document. The given features in this question are:

AnnotationCommentsHighlight and Bookmark

The correct answer to this question is the Comments.

Because you can add comments in someone else's document and only Comments features in word document allow you add comments on the someone else's document.

While the other options are not correct because:

The Annotation works with grammar or writing, Highlight feature allows you to mark important information or text in your document. while Bookmark allows you to save your space in a document.

PLEASE HURRY 30 POINTS
Which of the following statements describes the way networks are set up?

LANs are made up of LANs.

WANs are made up of WANs.

LANs are made up of WANs.

WANs are made up of LANs.

Answers

Wans are made up of lans

Answer:

WANs are made you of LANs

Explanation:

Which of the following Power BI tools is best suited for editing data before import?
A.)Power Pivot
B.)3D Maps(Power map)
C.)Power query editor

Answers

Answer:

C.)Power query editor

Explanation:

Power Query Editor is a tool in MS Excel 2010 which allows the user to locate, edit and load external data before importing it.

It imports data from different sources, joins, appends data and shapes data according to requirements.

The following data (in increasing order) for the attribute age: 13, 15,
16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25, 30, 33, 33, 35, 35, 35, 35, 36, 40, 45, 46,
52, 70.
(a) Use smoothing by bin means to smooth these data, using a bin depth of 3. Illustrate
your steps. Comment on the effect of this technique for the given data.
(b) How might you determine outliers in the data?
(c) What other methods are there for data smoothing?

Answers

Answer:

Explanation:

Step-by-step explanation:

13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25, 30, 33, 33, 35, 35, 35, 35, 36, 40, 45, 46, 52, 70.

a) Smoothing by bin means

Each bin has depth of 3

Dividing data into bins

so, Bin 1= 13, 15, 16

Bin 2=  16, 19, 20

Bin 3=  20, 21, 22

Bin 4= 22, 25, 25

Bin 5= 25, 25, 30

Bin 6= 33, 33, 35

Bin 7 = 35, 35, 35

Bin 8= 36, 40, 45

Bin 9=  46, 52, 70

Now, smoothing data by bin mean

so, Bin 1= 13, 15, 16 = (13+15+16)/3 = 15 Bin 1 = 15,15,15

Bin 2=  16, 19, 20 = (16+19+20)/3 = 18 Bin 2 = 18,18,18

Bin 3=  20, 21, 22= (20+21+22)/3 = 21 Bin 3 = 21,21,21

Bin 4= 22, 25, 25 = (22+25+25)/3 = 24 Bin 4 = 24,24,24

Bin 5= 25, 25, 30 =(25+25+30)/3 = 27 Bin 5 = 27,27,27

Bin 6= 33, 33, 35 = (33+33+35)/3 = 34 Bin 6 = 34,34,34

Bin 7 = 35, 35, 35 = (35+35+35)/3 = 35 Bin 7 = 35,35,35

Bin 8= 36, 40, 45 = (36+40+45)/3 = 40 Bin 8 = 40,40,40

Bin 9=  46, 52, 70=(46+52+70)/3 = 56 Bin 9 = 56,56,56

This technique is used to smooth the data. Data may have noise, using binning techniques we can remove noise from the data. It helps in providing more accurate results

b) How might you determine outliers in the data?

Outliers are the data that are abnormal to other data points. Outliers can be found by Box and whisker chart (box plot). Inter Quartile range can also be used to identify outliers

c)  What other methods are there for data smoothing?

Other methods of smoothing data are

a) binning by boundaries

b) Exponential smoothing

c) Random walk

Smoothing by bin means with a bin depth of 3 involves dividing the data into bins of size 3, and replacing each value in the bin with the mean of the bin.

What is bin depth?

According to the definition of equal depth binning, it divides the range into N intervals, each containing approximately the same number of samples.

The steps are as follows:

Bin 1: 13, 15, 16 → (13 + 15 + 16)/3 = 14.67

Bin 2: 16, 19, 20 → (16 + 19 + 20)/3 = 18.33

Bin 3: 20, 21, 22 → (20 + 21 + 22)/3 = 21

Bin 4: 22, 25, 25 → (22 + 25 + 25)/3 = 24

Bin 5: 25, 25, 30 → (25 + 25 + 30)/3 = 26.67

Bin 6: 33, 33, 35 → (33 + 33 + 35)/3 = 33.67

Bin 7: 35, 35, 35 → (35 + 35 + 35)/3 = 35

Bin 8: 35, 36, 40 → (35 + 36 + 40)/3 = 37

Bin 9: 45, 46, 52 → (45 + 46 + 52)/3 = 47.67

Bin 10: 70 → 70

(b) Data outliers can be identified using a variety of methods, including:

Z-score: For each data point, compute the Z-score, and consider any data point with a Z-score greater than 3 or less than -3 to be an outlier.The Tukey method: Calculate the data's interquartile range (IQR), and consider any data point that is more than 1.5 times the IQR below or above the first quartile to be an outlier.Visual examination: Plot the data and look for any values that seem out of place with the rest of the data.

(c) Other data smoothing methods include:

Moving average: Replace each data point within a specified window with the average of itself and its neighboring data points.Fit a polynomial to a moving window of data points and replace each data point with the value of the polynomial at that point using the Savitzky-Golay filter.Exponential smoothing: Assign each data point exponentially decreasing weights, with more recent data points receiving higher weights, and replace each data point with a weighted average of itself and the previous smoothed value.

Thus, this way, determine outliers in the data.

For more details regarding smoothing by bin, visit:

https://brainly.com/question/12982171

#SPJ2

In what stages of development process is a programmer or team most likely to intervoew a potential user of an app?A. investigating and reflecting B. designing C. prototyping D. testing

Answers

Answer:

D. testing

Explanation:

The testing stage is that stage where the developed application is put in the hands of potential users so as to gauge their experience with the product. Usually, a prototype that has the basic features of the main or original product is given to the potential user of an app. He is allowed to use the application for some time and is then later interviewed by the programmer to know what his experience was like when using it.

Through this means, any faults detected can be corrected by the programmer. This would also make the finished app better suited for the target users.

What is one advantage of using object-oriented programming?
A.
increases coding time
B.
makes debugging the code easier
C.
takes longer to plan
D.
has a longer learning curve
E.
creates single file code

Answers

I think that the answer is B

One advantage of using object-oriented programming makes debugging the code easier. The correct option is B.

What is object-oriented programming?

Programming in the object-oriented (OOP) manner identifies classes of objects that are closely related to the methods (functions) with which they are associated. It also covers the concepts of attribute and method inheritance.

Objects can be used in a variety of ways. Due to its modularity, extensibility, and reusability, object-oriented programming improves software development productivity when compared to traditional procedure-based programming techniques.

Functional programming, at its most basic, employs immutable data to instruct the program exactly what to do.

Therefore, the correct option is B. makes debugging the code easier.

To learn more about object-oriented programming, visit here:

https://brainly.com/question/11023419

#SPJ2

Assume you use Bubble Sort to sort a list with 15 elements (i.e.n= 9). Exactly howmany comparisons do you use (in the worst case)?

Answers

Answer:

Worst case is 55 but it really does depend on the numbers

Explanation:

1/2n squared -1

So that would be 7.5 squared -1

A merge field can be used multiple times in the same document.

A. True
B. False

Answers

TRUE, Yes you can you just have to redo the request for the identical information on the same spot in the same document.

PLEASE HURRY AND BE SERIOUS

Which of the following statements describes the way networks are set up?

LANs are made up of LANs.

WANs are made up of WANs.

LANs are made up of WANs.

WANs are made up of LANs.

Answers

Answer:  D: WANs are made up of LANs.

Explanation:

Answer:

answer is D WANS are made up of LANS

Explanation:

An IT security threat is anything that might cause serious harm to a computer system, including someone stealing a laptop that contains confidential information. Question 1
True
False

Answers

Answer: True

Explanation: Anything that is an IT threat is something that can compromise the integrity of the company or software and if that someone who stole a laptop has the information on it can get the information then there is a real risk that is faced to the company that owns that information.

Answer: True
Since a security threat is endangering the computer

what are 3 software programs for mobile computing?

Answers

Answer:

1.Communication Devices

2.Mobile hardware

3.Mobile software and apps

(smartphones, laptop, etc)

What characteristics do mentally healthy people exhibit? Check all that apply.

exercise 30 minutes a day
make their own decisions
are comfortable with other people
get overwhelmed by emotions
handle problems when they arise
make the best out of every situation

Answers

Make there own decisions

Handle problems when they arise

Make the best out of every situation

Maybe, are comfortable with people, but I’m not sure.

Hope this helps!!

Answer:

make their own decisions

are comfortable with other people

handle problems when they arise

make the best out of every situation

Explanation:

uses of diodes in the society​

Answers

Answer:

The application areas of diodes include communication systems as limiters, clippers, gates; computer systems as logic gates, clampers; power supply systems as rectifiers and inverters; television systems as phase detectors, limiters, clampers; radar circuits as gain control circuits, parameter amplifiers, etc.

Explanation:

Explanation:

I should understand this answer

Execution speed of a program on a computer processor varies with the language a programmer uses to code it. Select the correct option that
compares machine language with other languages.
The execution speed of machine language is
[___] than the execution speed of other languages.

Options:

slower
no different
faster

Answers

Answer:

faster

Explanation:

i took the test

Answer:

The answer is FASTER.

Explanation:

From PLATO!

What are the oop concept of java

Answers

Answer: OOP concepts in Java are the main ideas behind Java’s Object Oriented Programming. They are abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how Java works. Basically, Java OOP concepts let us create working methods and variables, then re-use all or part of them without compromising security.

HOPE THIS HELPED IS NOT SORRY.

OOP stands for Object Oriented Programming. In Java, we create classes to represent different things. For instance:

public class MyClass {

   public static void main(String args[]) {

     Car cr = new Car();

     cr.createCar("Ford", "Green", 2000);

     cr.printInfo();

   }

}

class Car{

   private String model, color;

   private int year;

   

   void createCar(String md, String cl, int yr){

       model = md;

       color = cl;

       year = yr;

   }

   void printInfo(){

       System.out.println("Car Info:");

       System.out.println("Model: "+model);

       System.out.println("Color: "+color);

       System.out.println("Year: "+year);

   }

}

We create a car object derived from the Car class with whatever properties we want and then we can display the properties of our car with the printInfo() method.

This is just one example of the OOP concept of Java.

Which Tab contains the font style attributes?

Answers

The home tab.

This tab contains the most-used Word features, such as tools for changing fonts and font attributes, customizing paragraphs, using styles, and finding and replacing text.

Other Questions
there is 2 different questions on here, answer them both and you get 100 points and brainliest. Read the excerpts from Does My Head Look Big in This? and Persepolis.Excerpt from Does My Head Look Big in This?:Forget sanity if you're the only one with a pass to sit in the back of church during service. Well, not every time. I remember once when I attended confession. I was in fourth grade. I was standing with my class in line to take the Eucharist. I wasnt supposed to be in line but I didnt feel like sitting like a loner in the back pew till the end of the service.Excerpt from Persepolis:A panel from the graphic novel Persepolis shows girls doing different things with the veil. One girl says it's too hot to wear the veil, one girl pretends she is a monster while wearing it, one girl skips with it, one girl pretends to be horse, and another girl is pretending to strangle someone with it.Which statement is true about the narrators different perspectives?It is exciting to do new and different things, even when you do not understand them.It is easy to do things that people tell you to do, even when you do not understand why. It can be difficult and confusing when you do not know why you need to do certain things.It is easy to make friends at a new school when you are different from everyone else. Read the passage from Animal Farm."Comrades!" cried Squealer, making little nervous skips, "a most terrible thing has been discovered. Snowball has sold himself to Frederick of Pinchfield Farm, who is even now plotting to attack us and take our farm away from us! Snowball is to act as his guide when the attack begins. But there is worse than that. We had thought that Snowball's rebellion was caused simply by his vanity and ambition. But we were wrong, comrades. Do you know what the real reason was? Snowball was in league with Jones from the very start! He was Jones's secret agent all the time. It has all been proved by documents which he left behind him and which we have only just discovered. To my mind this explains a great deal, comrades. Did we not see for ourselves how he attemptedfortunately without successto get us defeated and destroyed at the Battle of the Cowshed?"The animals were stupefied. This was a wickedness far outdoing Snowball's destruction of the windmill. But it was some minutes before they could fully take it in. They all remembered, or thought they remembered, how they had seen Snowball charging ahead of them at the Battle of the Cowshed, how he had rallied and encouraged them at every turn, and how he had not paused for an instant even when the pellets from Jones's gun had wounded his back. At first it was a little difficult to see how this fitted in with his being on Jones's side. Even Boxer, who seldom asked questions, was puzzled. He lay down, tucked his fore hoofs beneath him, shut his eyes, and with a hard effort managed to formulate his thoughts."I do not believe that," he said. "Snowball fought bravely at the Battle of the Cowshed. I saw him myself. Did we not give him 'Animal Hero, First Class,' immediately afterwards?""That was our mistake, comrade. For we know nowit is all written down in the secret documents that we have foundthat in reality he was trying to lure us to our doom."Which statement best explains the passage's connection to life in the Soviet Union under Joseph Stalin?Snowballs interaction with the farmers parallels the way in which spies undermined Stalins power.Boxer's puzzlement shows that he does not believe that Snowball is a traitor, which represents peoples loyalty to Stalin.Snowball's bravery during the Battle of the Cowshed earns him an award, which reflects the fighting that occurred.Squealer's false claim that he has documents to prove that Snowball is a traitor reflects lies used to control people. please help !! thank you A horse gallops 8 miles in 30 minutes. How many hours would it take the horseto gallop28 miles? Which statement best describes the governments of the city-states?Option 1 The city-states voted on which city-state would lead the rest.Option 2 Each city-state was independent and had its own form of governmentOption 3. The city-states were all part of one empire with the same governmentOption 4 All city-states had a similar form of government, since they were located near one another. What is the term used to describe the fact that cells are suited to perform a particular function within an organism? Which sentence from I Know Why the Caged Bird Sings best supports the answer in Part A?A I have tried often to search behind the sophistication of years for the enchantment I so easily found in those gifts. The essence escapes but its aura remains."B It didnt occur to me for many years that they were as alike as sisters, separated only by formal education." C I didnt question why Mrs. Flowers had singled me out for attention, nor did it occur to me that Momma might have asked her to give me a little talking to."D On the Arkansas summer days it seemed she had a private breeze which swirled around, cooling her." Stream 'Life Goes On' Army's!!!! naneun dangsin-eul bolasaeg What is mensuration? please help me.A. A system for indicating the rhythmic relationships between notes.B. A system for helping monks remember chant melodies.C. A system for indicating the picture relationships between notes.D. A system for indicating the relationship between notes and lyrics. help me, pleaseee Due to 22:00 WILL GIVE BRAINLYEST!!!!!!! PLEASE HELP!!!!Find the slope of the line drawn on the graph. If your answer is a fraction, leave in simplified fraction form. How was the Renaissance noble different from the medieval knight? * Write as a ratio in simplest form: 14 feet to 2 yards la la la la la la la la woah woah oh role of standard unit to bring uniformity in measurement please help me, i need this done by the end of my class period!!! Through the process of photosynthesis, plants make their own food using energy from the Sun, carbon dioxide from the air, and water from the ground. This food can then be stored for later use, or energy from the food can be released by the plant through the process of cellular respiration. This energy is then used to perform other life processes.What is another common use of the food produced by plants?Please I will mark brainliest just please help A.The food is converted entirely into heat energy.B.The food is vaporized to help fuel the Sun.C.The food is used by an animal when it consumes the plant.D.The food is excreted as waste and is no longer useful. Will give brainliest!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Scientists have discovered that the inner core of Earth is a solid while the outer core is a liquid. What is the cause of this observation? The outer core has a higher temperature and more pressure than the inner core The outer core has a lower temperature and lower pressure than the inner core The inner core has a lower temperature and higher pressure than the outer core The inner core has a higher temperature and lower pressure than the outer core It took thousands of years to form the Grand Canyon. What MOST LIKELY caused the formation of the canyon?A) glacial driftB) an earthquakeC) a rushing riverD) tectonic plates Cassie bought a new sweater Why do you think some sociologists feel American society is becoming more secular? *for sociology* WILL MARK AS BRAINLIEST!!