def func():
money = int(input("How much money will you have on holiday? "))
print("You will have {} euros.".format(int(money * 1.11)))
money = int(money * 1.11)
fifty = 0
twenty = 0
ten = 0
five = 0
while True:
if money - 50 >= 0:
fifty += 1
money -= 50
elif money - 20 >= 0:
twenty += 1
money -= 20
elif money - 10 >= 0:
ten += 1
money -= 10
elif money - 5 >= 0:
five += 1
money -= 5
if money < 5:
print("You will have {} fifties, {} twenties, {} tens, {} fives, and {} ones".format(fifty, twenty, ten, five, money))
return
func()
I hope this helps!
Answer:The original choice to write apply_fg so that it accepts function arguments is a good one, because it increases interoperability. When the callable arguments to apply_fg use a single protocol, we can easily exchange them: #include <functional> float log2(float); int a = apply_fg(5.Of, int b = apply_fg(3.14f,
Explanation:
Answer:
The C++ code is given below with appropriate comments
Explanation:
//Remove this header file if not using visual studio.
#include "stdafx.h"
//Include the required header files.
#include <iostream>
//Use for maths function.
#include <cmath>
using namespace std;
//Define main function
int main()
{
// Define the variables
double targetValue = 0.3333;
double sensorReading = 0.0;
//Perform the opeartion.
sensorReading = 1.0 / 3.0;
// Get the absolute floating point value and
// Check up to 4 digits.
if (fabs(sensorReading - targetValue) < 1E-4)
{
//Print equal if the values are close enough.
cout << "Equal" << endl;
}
else
{
//Print not equal if the values are not
//close enough.
cout << "Not equal" << endl;
}
system("pause");
//Return the value 0.
return 0;
}
The name of the programming language is “Brainfugd”