Answer:
// here is pseudo-code and implementation in java.
import java.util.*;
// class definition
class Solution
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// scanner object to read innput
Scanner s=new Scanner(System.in);
// variables
double item_cost;
System.out.print("Please enter cost of item:");
//read the cost of item
item_cost=s.nextDouble();
// calculate 10% tax on the item
double tax=item_cost*0.1;
// print original cost
System.out.println("original cost of item is: "+item_cost);
// print tax on the item
System.out.println("tax on the item is: "+tax);
// print total cost of item
System.out.println("total cost of item is:"+(item_cost+tax));
}catch(Exception ex){
return;}
}
}
Step-by-step explanation:
Read the original cost of item from user and assign it to variable "item_cost". Calculate 10% tax on the cost of item and assign it to variable "tax".Print the original cost and tax on item.Then add the cost and tax, this will be the total cost of item and print it.
Output:
Please enter cost of item:125
original cost of item is: 125.0
tax on the item is: 12.5
total cost of item is:137.5