Answer:
def find_max(num_1, num_2):
max_val = 0.0
if (num_1 > num_2): # if num1 is greater than num2,
max_val = num_1 # then num1 is the maxVal.
else: # Otherwise,
max_val = num_2 # num2 is the maxVal
return max_val
max_sum = 0.0
num_a = float(input())
num_b = float(input())
num_y = float(input())
num_z = float(input())
max_sum = find_max(num_a, num_b) + find_max(num_y, num_z)
print('max_sum is:', max_sum)
Explanation:
I added the missing part. Also, you forgot the put parentheses. I highlighted all.
To find the max_sum, you need to call the find_max twice and sum the result of these. In the first call, use the parameters num_a and num_b (This will give you greater among them). In the second call, use the parameters num_y and num_z (This will again give you greater among them)
Answer:
The program to this question can be given as follows:
Program:
#include <stdio.h> //include header file for using basic function
int main() //defining main method
{
int strawsOnCamel=0; //defining integer variable and assign value
for(int i=1;i<=5;i++) //loop for increment integer variable value
{
//code
strawsOnCamel++; //increment value by 1
printf("%d\n", strawsOnCamel); //print value
}
return 0;
}
Output:
1
2
3
4
5
Explanation:
In the C language code above the header file is entered, and a whole variable strawsOnCamel is specified within the main method, which gives a value of 0.
- Then a for loop is defined inside a loop an integer variable i declared that starts from 1 and ends with 5.
- Inside a loop, the strawsOnCamel variable is used that increments its value by 1 and prints its value.
Answer: $1,500
Explanation:
The future value of value using simple interest is:
Future value = Value * ( 1 + rate * time)
2,400 = Value * (1 + 15% * 4)
2,400 = Value * 1.6
Value = 2,400 / 1.6
Value = $1,500
Answer:
A Program was written to carry out some set activities. below is the code program in C++ in the explanation section
Explanation:
Solution
CODE
#include <iostream>
using namespace std;
int main() {
string name; // variables
int number;
cin >> name >> number; // taking user input
while(number != 0)
{
// printing output
cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;
// taking user input again
cin >> name >> number;
}
}
Note: Kindly find an attached copy of the compiled program output to this question.
Because the string is invalid or your source is not attached to your search engine.