In python:
i = 1
lst1 = ([])
lst2 = ([])
while i <= 5:
person1 = int(input("Enter the salary individual 1 got in year {}".format(i)))
person2 = int(input("Enter the salary individual 1 got in year {}".format(i)))
lst1.append(person1)
lst2.append(person2)
i += 1
if sum(lst1) > sum(lst2):
print("Individual 1 has the highest salary")
else:
print("Individual 2 has the highest salary")
This works correctly if the two individuals do not end up with the same salary overall.
Answer:
Cyber stalking involves using electronic means , including Internet or to stalk or harass a person . I
It will normally result in rules that are more complex and more difficult to understand option (C) is correct.
<h3>What is tail recursion?</h3>
The recursive function is essentially used as the function's final statement in the tail recursion.
If we try to use tail-recursive rules to implement non-tail-recursive rules, it will normally result in rules that are
A. simpler and easier to understand.
B. circular rules.
C. more complex and more difficult to understand.
D. more time-consuming in execution.
The recursive function is essentially used as the function's final statement in the tail recursion. Therefore, tail recursion is what happens when nothing remains to be done after returning from the recursive function.
Thus, if we try to use tail-recursive rules to implement non-tail-recursive rules, it will normally result in rules that are more complex and more difficult to understand option (C) is correct.
Learn more about the tail recursion here
brainly.com/question/20749341
#SPJ4
Answer:
import java.util.Scanner;
public class Supermarket
{
public static void main (String[] args)
{
String item;
double pounds, ounces, price,
total, unit;
Scanner scn = new Scanner(System.in);
System.out.print("Please enter the name of item ");
item = scn.nextLine();
System.out.print("Please enter the price of " + "the item per pound : ");
price = scn.nextDouble();
System.out.print("Enter the weight of " + "the item in pounds and " + "ounces respectively : ");
pounds = scn.nextDouble();
ounces = scn.nextDouble();
unit = price/16;
total = price * (pounds + ounces/16);
System.out.print("The unit price of " + "the products sold is : " + unit);
System.out.print("\nThe total cost of the " + "amount purchased is : " + total);
}
}
Explanation:
- Ask the user to enter the price of the item and the weight.
- Calculate the unit and the total price.
- Display the unit and the total price.