Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Scanner; public class ManualCostCalculator { public static void main ( String [ ] args ) { final double PER _ PAGE _ BW =

import java.util.Scanner;
public class ManualCostCalculator {
public static void main(String[] args){
final double PER_PAGE_BW =2.5;
final double PER_PAGE_COLOR =0.25;
final double PAGE_WEIGHT =0.2;
int totPageCount =0;
int colPageCount =0;
double covCost =0.0;
double prinCost =0.0;
double colCost =0.0;
double weight =0.0;
double mailCost =0.0;
Scanner input = new Scanner(System.in);
System.out.println("Program to calculate training manual costs
");
System.out.println("Enter the number of black and white pages:");
totPageCount = input.nextInt();
System.out.println("Enter the number of color pages:");
colPageCount = input.nextInt();
System.out.println("
There are "+(totPageCount + colPageCount)+" pages in the training manual
");
System.out.print("Enter the cover cost:");
covCost = input.nextDouble();
System.out.println("
Enter the budget for training manuals:");
double budget = input.nextDouble();
prinCost = totPageCount * PER_PAGE_BW + colPageCount * PER_PAGE_COLOR;
colCost = colPageCount * PER_PAGE_COLOR;
weight =(totPageCount + colPageCount)* PAGE_WEIGHT;
System.out.println("
For one manual:");
System.out.printf(" Black & white printing cost per page is %.1f%n", PER_PAGE_BW);
System.out.printf(" Color printing cost per page is %.2f%n", PER_PAGE_COLOR);
double totalManualCost = prinCost + colCost + covCost;
System.out.printf("Total printing cost per manual with cover is %.2f%n", totalManualCost);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago