Answer:
public static void PrintShampooInstructions(int numberOfCycles){
if (numberOfCycles<1){
System.out.println("Too Few");
}
else if(numberOfCycles>4){
System.out.println("Too many");
}
else
for(int i = 1; i<=numberOfCycles; i++){
System.out.println(i +": Lather and rinse");
}
System.out.println("Done");
}
Explanation:
I have used Java Programming language to solve this
Use if...elseif and else statement to determine and print "Too Few" or "Too Many".
If within range use a for loop to print the number of times
Answer:
val > max
Explanation:
Assuming the values array is already created, inside the loop, we need to check if the val, a value in the values array, is greater than max. If it is greater than the max, that means it is our new max. Then we would set the max as the val. This way, if there is any value greater than max, it will be our max at the end of the loop.
Answer:
- def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):
- gallon_used = driven_miles / miles_per_gallon
- cost = gallon_used * dollars_per_gallon
- return cost
-
- miles_per_gallon = float(input("Input miles per gallon: "))
- dollars_per_gallon = float(input("Input dollar per gallon: "))
-
- cost1 = driving_cost(10, miles_per_gallon, dollars_per_gallon)
- cost2 = driving_cost(50, miles_per_gallon, dollars_per_gallon)
- cost3 = driving_cost(400, miles_per_gallon, dollars_per_gallon)
-
- print("$ %.2f" % cost1)
- print("$ %.2f" % cost2)
- print("$ %.2f" % cost3)
Explanation:
The solution is written in Python 3.
Firstly, create a function driving_cost that takes three parameters, driven_miles, miles_per_gallon and dollars_per_gallon (Line 1). In the function, calculate the gallon consumption by applying formula driven_miles / miles_per_gallon and then use it to calculate the cost (Line 2 - 3). Return the cost as output (Line 4).
In the main program, prompt user to input miles per gallon and dollars per gallon and then use these input values as arguments to call the function driving_cost function for three times with each time with different driven_miles value (Line 6 - 11).
At last, use formatted print to display the output to two decimal points (Line 13 - 15).
Answer: <em>The biggest difference between the two is their functionality. Internet Banking allows you to conduct online transactions through your PC or laptop and an internet connection. On the other hand, mobile banking can be done with or without internet. Many banks nowadays have their mobile apps for mobile banking.</em>
Disadvantages of Mobile Banking
<em>If the customer does not have a smartphone than the use of Mobile Banking becomes limited. A transaction like transfer of funds is only available on high-end phones. Regular use of Mobile Banking may lead to extra charges levied by the bank for providing the service.</em>
<em />
Explanation: <u><em>Was this helpful to you? if so please put me Brainlyest.</em></u>