1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OleMash [197]
2 years ago
11

Write a program that calculates the cost of a phone call. The user enters a positive integer that

Computers and Technology
1 answer:
san4es73 [151]2 years ago
5 0
Add the following constants in the class definition, before the main method:

    private final static float START_COST = 1.5f;
    private final static float HIGH_TARIFF = 0.5f;
    private final static float LOW_TARIFF = 0.25f;
    private final static int FIXED_MINS = 2;
    private final static int HIGH_TARIFF_MINS = 10;

Then add this to the main method you already had:

        float price = START_COST;
        if (x > FIXED_MINS) {
            if (x <= HIGH_TARIFF_MINS) {
                price += HIGH_TARIFF*(x-FIXED_MINS);
            }
            else {
                price += HIGH_TARIFF*(HIGH_TARIFF_MINS-FIXED_MINS) 
                    + LOW_TARIFF*(x-HIGH_TARIFF_MINS);
            }
        }   
        System.out.printf("A %d minute call costs %.2f", x, price);      

You might be interested in
While software vendors generally provide evaluation or demonstration copies of their products, hardware vendors never provide ev
meriva

Answer:

False

Explanation:

Even with the expenses of hardware, hardware vendor still provide evaluation or demonstration copies of their products just like software vendors but not as often.

7 0
2 years ago
Write the statements needed so that the variable secondWord is associated with the second word of the value of sentence . So, if
professor190 [17]

Answer:

Explanation:

String str = "Broccoli is delicious.";

String[] Secondstr = str.split(" ");

System.out.println("second word is " + Secondstr[1]);

3 0
3 years ago
Truck drivers probably can't see your vehicle if ______________.
Arada [10]
<h2>Answer:</h2>

Truck drivers probably can't see your vehicle if you cannot see them in their side mirror

<h2>Explanation:</h2>

In driving terminology there is a term called the bind spot. Blind spot is the area where the driver is not able to see the vehicle behind him and this area is present just behind the truck and very close to the gates of the car. Since trucks do not have the rare mirror therefore if a car is present in their blind spot they wont be able to see it. The driver behind the truck can spot it if he does not see the truck driver in the side mirror of the truck.

5 0
3 years ago
Read 2 more answers
What are some examples of the kinds of information that might be included in a career definition section of a career plan? Check
Ganezh [65]

Answer:

3.) job title

5.) job location

6.) level of pay

7.) description of employer

Explanation:

Career Plans can be defined as the plans that an individual makes regarding the advancement or growth his or her career.

Career Plans are plans that involve steps an individual intends to take to advance their career growth and they are:

• Short term goals

• Intermediate goals

• Long term goals

• Academic pursuits or certifications to further advance your career

• Internships the individual plans to embark on e.t.c.

A career plan has different sections that it is subdivided into. They are:

a) Personal Section: This included information about yourself, your educational background, e.t.c.

b) Skills Section

c) Career definition section

In a career definition section of a career plan, this section is about where that individual is currently in their career. The information contained in this section includes:

• Job title

• Job location

• Level of pay

• Description of employer

6 0
3 years ago
Read 2 more answers
What is the term for an e-mail server program that receives sent messages and delivers them to their proper destination?
Katarina [22]
MTA (Mail Transfer Agent)
6 0
3 years ago
Other questions:
  • What item on a business card is generally the most prominent?
    13·2 answers
  • What does FTP stand for?
    15·2 answers
  • The convergence of information technology and operations technology, offering the potential for tremendous improvements in effic
    14·1 answer
  • Public-key cryptography can be used for encryption (ElGamal for instance) and key exchange. Furthermore, it has some properties
    9·2 answers
  • Is there a relationship between cybercrime and traditional crime?
    6·1 answer
  • 5. Question<br> The control flag that isn't really in use by modern networks is the<br> flag.
    15·1 answer
  • If you're unsure of what chart to use for a set of data, what feature does Excel include that will help you to decide?
    7·1 answer
  • The executive ________ is the person ultimately responsible to their company for the project's success.
    13·1 answer
  • Name:
    11·1 answer
  • Please answer me <br> in Assignment - Algorithms
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!