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
alexandr1967 [171]
2 years ago
7

Write a calculate_sq_inches_of_good_pizza function that accepts the diameter of a pizza and returns the area of the pizza minus

1 inch at the edge.
Computers and Technology
1 answer:
Feliz [49]2 years ago
6 0

Answer:

#include <iostream>

using namespace std;

<em>float</em><em> calculate_sq_inches_of_good_pizza(float diameter) { </em>

<em>    </em><em>float</em><em> radius= diameter/2;     </em>

<em>    </em><em>float</em><em> pi=3.14;</em>

<em>    </em><em>float</em><em> area;        </em>

<em>    area = pi</em><em>*</em><em>(radius</em><em>*</em><em>radius );</em>

<em>    </em><em>return</em><em> area;</em>

<em>} </em>

int main() {  

   float d;

   cout<<"enter the diameter of pizza"<<endl;

   cin>>d>>endl;

   float area_of_pizza = calculate_sq_inches_of_good_pizza();

   return 0;

}

Explanation:

Above program is written in C++ language which has function namely    float calculate_sq_inches_of_good_pizza(float diameter). This will calculate area of pizza from  given diameter and return it to main() function.

As we know pizza is circle and area of circle is equal to:

Area = π * radius*radius

π =pi=3.14

and we have calculated radius from given diameter

radius = diameter/2;

If you only want function not whole program than ignore main () function and only consider float calculate_sq_inches_of_good_pizza(float diameter) function which is in ITALIC notation.

You might be interested in
Assume that success is a variable of type boolean that has been declared. Assume that processor refers to an object that provide
Iteru [2.4K]
Try {
AutoFactory.shutdown();
} catch (ProductionInProgressException e) {
AutoFactory.reset();
}
6 0
2 years ago
What is an accurate definition of a goal?
notka56 [123]

Answer:

something specific a person wants to achieve m8

Explanation:

5 0
2 years ago
Read 2 more answers
Which menu would most likely allow you to choose a font A.file B.Edit C.format D.insert​
Ksivusya [100]

Answer:

D

Explanation:

7 0
2 years ago
The file includes 4993 tweets including the keyword 'election'. Each tweet is represented in a separate line. Write a program to
Likurg_2 [28]

Answer:

import re

with open("../../Downloads/Tweets.txt","r", encoding="utf-8") as tweets:

   myfile = tweets.readlines()

   for item in myfile:

       item = item.rstrip()

       mylist = re.findall("^RT (.*) ", item)

       if len(mylist) !=0:

           for line in mylist:

               if line.count("#") >=1:

                   ln = line.split("#")

                   dm = ln[1]

                   print(f"#{dm}")

Explanation:

The python source code filters the document file "Tweets" to return all tweets with a hashtag flag, discarding the rest.

7 0
2 years ago
Discuss one simple example of hybrid computer.​
andrezito [222]

Answer:

thermometer , petrol pump

5 0
2 years ago
Other questions:
  • I NEED HELP NOW PLEASE!!!!!!
    6·2 answers
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • Graphs and charts are two different elements. True or False
    15·1 answer
  • Which best describes a difference between transcription and DNA replication
    8·2 answers
  • Which is worse: Fast charging (Due to heat) or unplugging before reaching full capacity (On a normal charge)?
    9·1 answer
  • A user reports that he cleared a paper jam and now cannot print. The technician reseats the paper and then prints a test page fr
    14·1 answer
  • Compare the two items in a summary of qualifications taken from a resumé. Which is better?
    9·1 answer
  • What is contained in the Open Files section of Shared Folders? ​
    13·1 answer
  • Use the ________ tag to configure a generic area on a web page that is embedded within a paragraph or other block display elemen
    12·1 answer
  • A data use agreement is required when a researcher uses a limited data set (lds). an lds must have:_________
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!