Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in java. A company supervisor wants to monitor that usage of the office laser printer and at the same time, determine how long a

write in java.

A company supervisor wants to monitor that usage of the office laser printer and at the same time, determine how long a laser toner lasts. He asks those who used the printer to log the number of printed pages.

After a period of time, the supervisor took away the log book so he can determine the average daily cost of printing. In particular, he wants to know the life span of a toner. Assuming that a toner has a page yield of 3000 pages, the cost per page is then determined by the following formula:

Cost per page = cost of toner / 3000

Since the average daily number of printed pages can be readily computed, then the average daily cost can be computed by the following formula:

Average daily cost = average page count * cost per page

The life span of the toner is then determined by the following formula:

Life span = cost of toner / average daily cost

Write a Java program that determines the average daily cost and the life span of the toner, given the cost of the toner and the daily number of printed pages for a given period.

INPUT

The first line contains the cost of the toner and the number of days the daily number of printed pages is monitored. The user then enters the daily number of printed pages for the given number of days.

OUTPUT

After the input, the program shows two lines of output. The first line contains the text "Average daily cost of toner use is ", followed by the average daily cost value. The second line contains the text "Toner lifetime is ", followed by the life span value.

SAMPLE INPUT 3000 10 325 110 80 90 70 140 167 85 50 44 SAMPLE OUTPUT Average daily cost of toner use is 116.00 Toner lifetime is 26 days

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions