Hi, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.
Answer:
import math
def rectangle(perimeter, area):
l1_1 = (perimeter+math.sqrt((perimeter**2)-(16*area)))/4
l1_2 = (perimeter-math.sqrt((perimeter**2)-(16*area)))/4
l2_1 = area/l1_1
l2_2 = area/l1_2
print(l1_1,l2_1)
print(l1_2,l2_2)
if l1_1.is_integer() and l2_1.is_integer() and l1_1>0 and l2_1>0:
return(int(max(l1_1,l2_1)))
elif l1_2.is_integer() and l2_2.is_integer() and l1_2>0 and l2_2>0:
return(int(max(l1_2,l2_2)))
else:
return(None)
Explanation:
- We import math to make basic operations
- We define the rectangle function that receives perimeter and area
- We calculate one of the sides (l1_1) of the rectangle using the quadratic equation to solve 2h^2 - ph + 2a = 0
- We calculate the second root of the quadratic equation for the same side (l1_2)
- We calculate the second side of the rectangle using the first root on w = a/h
- We calculate the second side of the rectangle using the second root on w= a/h
- We verify that each component of the first result (l1_1, l2_1) is an integer (using the build-in method .is_integer) and greater than 0, if True we return the maximum value between them (using the max function) as w
- If the first pair of sides evaluate to False we check the second root of the equation and if they meet the specification we return the max value
- if all the if statements evaluate to false we return None to indicate that not positive or integer sides were found
Answer:
Broadcast message
Explanation:
A broadcast message is an identical message sent to a lot of recipients. When it is an email, it can be sent in Carbon Copy (Cc) or a Blind Carbon Copy (Bcc) form.
With the<em> Carbon Copy</em>, every recipients will be notified about the other recipients. In most cases all the email usernames of the recipients will be sent to all the recipients individually.
With the <em>Blind Carbon Copy</em>, every individual sees the message as he/she received it alone. The individual is not notified about the other recipients.
They modify is bcuz every race car is different and the driver is going to want something different then everyone else.
It would be:
b.) poe cable
message me on my profile if you need any more help! :)
Answer:
- import java.util.Scanner;
- public class Main {
-
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter meal total: $");
- double meal = input.nextDouble();
- double finalAmount = meal + meal *0.09;
-
- if(finalAmount * 0.15 > 8){
- finalAmount = finalAmount + 8;
- }else{
- finalAmount = finalAmount + finalAmount * 0.15;
- }
- System.out.println("Final amount: $" + finalAmount);
- }
- }
Explanation:
Firstly, create a Scanner object and print user to input total meal (Line 5-7). Next, add the 9% tax to the meal total (Line 8). Use an if statement to check if the finalAmount multiplied by the 15% of tips is bigger than 8 (Line 10), if so, only add 8 to the final amount (Line 11). If not, add 15% tips to final amount (Line 12). At last, print out the final amount (Line 15).