Answer:
- import java.util.Scanner;
-
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Input total sales of month: ");
- double totalSales = input.nextDouble();
-
- double stateTax = totalSales * 0.04;
- double countyTax = totalSales * 0.02;
- double totalSalesTax = stateTax + countyTax;
-
- System.out.println("County Tax: $" + countyTax);
- System.out.println("State Tax: $" + stateTax);
- System.out.println("Total Sales Tax: $" + totalSalesTax);
- }
- }
Explanation:
Firstly, create a Scanner object and prompt user to input total sales of month (Line 5-7). Next, apply the appropriate tax rate to calculate the state tax, county tax (Line 9 - 10). Total up the state tax and county tax to get the total sales tax (Line 11).
At last, print the county tax, state tax and the total sales tax (Line 13 - 15).
Hi, you haven't provided the programing language, therefore, we will use python but you can extend it to any programing language by reading the code and the explanation.
Answer:
n1 = int(input("First numeber: "))
n2 = int(input("Second numeber: "))
for i in range(5):
r1 = n1%10
r2 = n2%10
print(r1+r2)
n1 = n1//10
n2 = n2//10
Explanation:
- First, we ask for the user input n1 and n2
- We create a for-loop to calculate the sum of each place-value of two numbers
- We obtain the last number in n1 by using the mod operator (%) an the number ten this way we can always take the last value, we make the same for n2
- Then we print the result of adding the last two numbers (place value)
- Finally, we get rid of the last value and overwrite n1 and n2 to continue with the process
Answer:Message length
Explanation:Electronic data interchange(EDI) is the communication path that is established for the interchanging of business documents between the connected organization and partners electronically.
It has several benefits such as security maintenance , increasing productivity, enhancing the customer -related services and also minimizing the length of the data so that it can have accuracy and be on-point rather than being unnecessarily detailed.
Answer:
- jersey_dict = {}
-
- for i in range(5):
- j_num = int(input("Input Jersey's number (0-99): "))
- rating = int(input("Input rating (1 - 9): "))
- jersey_dict[j_num] = rating
-
- sorted_key = []
- for i in jersey_dict.keys():
- sorted_key.append(i)
-
- sorted_key.sort()
- for i in sorted_key:
- print(str(i) + ":" + str(jersey_dict[i]))
Explanation:
Firstly, define an empty dictionary (Line 1).
Next, use a for loop to prompt user to input five Jersey's number and rating and keep the input to the dictionary (Line 3-6). Next, create a list to hold the dictionary keys (Line 8-10). Use build in method, sort to arrange the keys in the list in ascending order (Line 12 ). At last, print the dictionary element by looping over the value in the sorted_key list (Line 14-15).