Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
28
Task/Documentation/C++/documentation.cpp
Normal file
28
Task/Documentation/C++/documentation.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Program Title: Rosetta Code, Documentation
|
||||
* Author : John Doe
|
||||
* Version : 0.1
|
||||
* Date : 2023/12/31
|
||||
* Copyright : Public domain
|
||||
* Description : An example of C++ program documentation
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <numbers>
|
||||
|
||||
/*
|
||||
* Calculates the area of a circle with the given radius
|
||||
*/
|
||||
double area_circle(const double& radius) {
|
||||
return (std::numbers::pi * radius * radius);
|
||||
}
|
||||
|
||||
// Controls the program
|
||||
int main() {
|
||||
// Obtain the users input
|
||||
double radius;
|
||||
std::cout << "Enter the radius of a circle in centimetres: ";
|
||||
std::cin >> radius;
|
||||
|
||||
// Display the result
|
||||
std::cout << "The area of the circle is " << area_circle(radius) << " cm\u00b2" << "\n";
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
(phixonline)-->
|
||||
<span style="color: #008080;">procedure</span> <span style="color: #000000;">StoreVar</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">N</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">NTyp</span><span style="color: #0000FF;">)</span>
|
||||
<span style="color: #000080;font-style:italic;">--
|
||||
-- Store a variable, applying any final operator as needed.
|
||||
-- If N is zero, PopFactor (ie store in a new temporary variable of
|
||||
-- the specified type). Otherwise N should be an index to symtab.
|
||||
-- If storeConst is 1, NTyp is ignored/overridden, otherwise it
|
||||
-- should usually be the declared or local type of N.
|
||||
-- </span>
|
||||
<span style="color: #0000FF;">...</span>
|
||||
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
|
||||
<!--
|
||||
procedure StoreVar(integer N, integer NTyp)
|
||||
--
|
||||
-- Store a variable, applying any final operator as needed.
|
||||
-- If N is zero, PopFactor (ie store in a new temporary variable of
|
||||
-- the specified type). Otherwise N should be an index to symtab.
|
||||
-- If storeConst is 1, NTyp is ignored/overridden, otherwise it
|
||||
-- should usually be the declared or local type of N.
|
||||
--
|
||||
...
|
||||
end procedure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue