1. The department of History has just bought a new photocopier. Any person using the photocopier must enter an identification code.  You have been asked to do the following:
• Write a program that determines whether identification codes typed by users of a photocopier are valid, and prints appropriate messages. If the identification code, which is a four-digit number, is correct your program computes the cost of copying according to the table below.
• Your program should prompt the user for an identification code, read it and determine whether it is valid. An identification code is valid if its rightmost digit is correct.  A correct digit is equal to the remainder of the sum of the other three digits divided by 7. For example, a valid code that gives a correct digit is   7011.  However, 9999 is not a valid code. 7011 is a valid code because (7+0+1)%7 = 1, which is equal to the rightmost digit of 7011.  But 9999 is not a valid code because (9+9+9)%7 = 6, which is not equal to the rightmost digit of  9999.

Correct digits are assigned as follows:

Student: 1, 2   (means 1 or 2)

Teacher: 3, 4, 5

Secretary: 6

Others: 7, 8, 9

 Number of pages 1 to 10 10 to 20 >20 Students 0.10 Dhs 20% off 40% off Teachers 0.30 Dhs 30% off 40% off Secretaries 0.20 Dhs 25% off 40% off Others 0.60 Dhs 10% off 20% off

Apr 16, 2020 in Java 449 views

## How can I do url string decoding in java

We can use URLDecoder: URLDecoder.decode( url, "UTF-8" ); READ MORE

## Unfortunately MyApp has stopped. How do I solve this?

The common solution for solving App has ...READ MORE

## How can I solve this: To prevent a memory leak, the JDBC Driver has been forcibly unregistered

What can you do? Ignore these warnings. Tomcat ...READ MORE

+1 vote

## How can I solve this example in an easy way??

You can use this code: import java.util.*; public class ...READ MORE

## What is Modeshape. How can i use this?

ModeShape is an open-source implementation of the JSR-283 specification and ...READ MORE

## How can I convert a String variable to a primitive int in Java

Here are two ways illustrating this: Integer x ...READ MORE

+1 vote

## How to send HTTP POST requests on Java?

With Apache HttpClient In the old days, this Apache ...READ MORE