Answer: Provided in the explanation section
Explanation:
Provided is the code to run this program
Source Code:
import java.util.Scanner;
class PrintJobCost
{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.print("Enter print job info:");
String info=input.nextLine();
String size="",type="";
int count=0,i=0,len=info.length();
double cost=0.0;
while(info.charAt(i)!=' '){
size=size+info.charAt(i);
i++;
}
i++;
while(info.charAt(i)!=' '){
type=type+info.charAt(i);
i++;
}
i++;
while(i<len){
count=count*10+Integer.parseInt(String.valueOf(info.charAt(i)));
i++;
}
if(size.equals("Letter"))
cost=cost+0.05;
else if(size.equals("Legal"))
cost=cost+0.06;
else if(size.equals("A4"))
cost=cost+0.055;
else if(size.equals("A5"))
cost=cost+0.04;
if(type.equals("Grayscale"))
cost=cost+0.01;
else if(type.equals("Colored"))
cost=cost+0.10;
cost=cost*count;
System.out.printf("print job Cost:$ %.2f\n",cost);
}
}
cheers i hope this helped !!!