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]
3 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]3 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
If you want the values in your cell to have dollar signs in front of them, _________
Vlad1618 [11]
Use the number formatting option
4 0
3 years ago
In java, c or c++ code, when a number begins with a leading 0, what do you know about that number: (example: int zzz = 012;) in
Katarina [22]
A leading 0 denotes octal notation, so the digits 8 and 9 are not used.
In normal decimal notation 12 means 1*10+2, in octal, it means 1*8+2.

The leading 0x denotes hexadecimal notation, here the digits are extended with 6 letters, a through f. 0x12 means 1*16+2.

Without any prefix, we have normal decimal notation.
5 0
4 years ago
Is it possible to have a deadlock involving only oneprocess? Explain your answer.
Aleonysh [2.5K]

Answer:

Hi!

It is not possible to have a deadlock involving only one process.

Explanation:

Deadlock is only possible if there are multiple processes trying to access the same shared resources. Another way to see it is if you have shared resources only can be a deadlock if multiple processes attempt to use it.

With only one process, you can use shared resources without the risk of fall into deadlock, but you don't have concurrence either.

4 0
4 years ago
Which statement describes a disadvantage of e-government?
kicyunya [14]

Answer:

Setting up and maintaining the online systems can be expensive

Explanation:

4 0
4 years ago
What is the different between information and data
Vika [28.1K]
Data is an individual unit that contains raw materials which do not carry any specific meaning. Information is a group of data that collectively carries a logical meaning.
7 0
3 years ago
Other questions:
  • In cell F29, use an IF function to display the correct Shipping Charge, based on the amount of the Discounted Total. If the Disc
    9·1 answer
  • Sending packets with false ip source addresses is called ____. ip address spoofing a port scanning attack a ip address scanning
    11·1 answer
  • Can someone explain to me what coom means? kekw
    12·1 answer
  • The Maui coffee shop sells coffee at $10.50 a pound plus the cost of shipping. Each order ships for $0.86 per pound + $1.50 fixe
    14·1 answer
  • Which of the following statements about arrays are true?
    10·1 answer
  • An engineer's desktop PC connects to a switch at the main site. A router at the main site connects to each branch office through
    5·1 answer
  • The term "exception propagation" means:
    5·1 answer
  • What 3 types of data can be entered in a spreadsheet
    14·1 answer
  • You are assigned by your teacher to perform the assembly of all the parts of the computer in preparation for the hands on activi
    7·1 answer
  • Do you need to have java on your computer.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!