Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge.

Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possible that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Write the program so it will generate the output as shown in the sample runs below where user input is in bold. Without coupons adult haircut is 15.50 and the child haircut is 10.50. Sample Run 1 Enter coupon color(θ=no coupon,1=green,2=blue):1 Enter the type of haircut (a=adult ork=kid):a The charge is 12.00

Write a C++ program that asks the user to enter the coupon color and the haircut type (adult, kid) and then determine the haircut charge. It is possible that a customers may not have a coupon, in that case, no discount will be offered. You can assume that green, blue colors are represented using 1 and 2 respectively. Write the program so it will generate the output as shown in the sample runs below where user input is in bold. Without coupons adult haircut is 15.50 and the child haircut is 10.50

Read More

Write a program to takes in width, height and length of a box and calculate the volume of the box. Display the volume

1. Write a program to takes in width, height and length of a box and calculate the volume of the box. Display the volume. Volume of box = width x height x length 2. When Azmi began his trip from Johor Bahru to Alor Setar, he filled his car's tank with gas and reset its trip to zero. After travelling for 234 miles, Azmi stopped at a gas station to refuel; the gas tank required 15 gallons. Create a program that Azmi can use to display his car's mileage - number of miles his car can be driven per gallon of gas at anytime during the trip.

1. Write a program to takes in width, height and length of a box and calculate the volume of the box. Display the volume. Volume of box = width x height x length 2. When Azmi began his trip from Johor Bahru to Alor Setar, he filled his car’s tank with gas and reset its trip to zero. After travelling for 234 miles, Azmi stopped at a gas station to refuel; the gas tank required 15 gallons. Create a program that Azmi can use to display his car’s mileage – number of miles his car can be driven per g

Read More

Define a function trophiclevelindex(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below.

Define a function trophic_level_index(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below. The TLI3 is calculated as the average of the three transformed values, where each value is transformed as follows: tlc = 2.22 + 2.54 ∗ log10​CHLA tln = −3.61 + 3.01 ∗ log10​TN tlp = 0.218 + 2 .92 ∗ log10​TP ​For example, if CHLA = 10, TN = 100, and TP = 1000, then: tlc = 2.22 + 2.54 ∗ 1 = 4.76 tln = −3.61 + 3.01 ∗ 2 = 2.410 tlp = 0.218 + 2.92 ∗ 3 = 8.978 and TLI3 = 5.383 (to 3 decimal places) Notes: - The notation log10​x means the logarithm to base 10 of x, i.e. the power to which 10 must be raised to yield x. - In Python, log10​x can be calculated (after importing the math module) as math.log(x, 10) - You can assume that CHLA, TN, and TP values are positive, i.e. greater than 0. - Your function should not round its result. - TN, TP, and CHLA are commonly used variable names in the literature, so you can use the following variable names in your code in this assignment: tn, tp, and chla (note they are lower case).

Define a function trophic_level_index(chla , tn, tp) that takes values for Chorophyll-a (CHLA), Total Nitrogen (TN), and Total Phosphorus (TP) and returns the Trophic Index (TLI3) using the calculation below. The TLI3 is calculated as the average of the three transformed values, where each value is transformed as follows: tlc = 2.22 + 2.54 ∗ log10​CHLA tln = −3.61 + 3.01 ∗ log10​TN tlp = 0.218 + 2 .92 ∗ log10​TP ​For example, if CHLA = 10, TN = 100, and TP = 1000, then: tlc = 2.22 + 2.54 ∗ 1 =

Read More