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
olga_2 [115]
4 years ago
11

cellPhoneBill(m,tx)Write the function cellPhoneBill()that takes two int m and txas input and returns a float.The function takes

total number of minutes and text messages that user spends in a particular month and returns the bill amount. These is the policy of the carrier company:
Computers and Technology
1 answer:
lidiya [134]4 years ago
4 0

Answer:

The solution code is written in C++

  1. float cellPhone(int m, int tx){
  2.    float COST_PER_MIN = 0.1;
  3.    float COST_PER_MESSAGE = 0.2;
  4.    
  5.    float bill_amount = m * COST_PER_MIN + tx * COST_PER_MESSAGE;
  6.    
  7.    return bill_amount;
  8. }

Explanation:

Firstly, declare a function named cellPhone() that takes two input parameters, m and tx (Line 1).

Since the policy of the carrier company is not given in the question, I make a presumption that the cost per minutes is $0.10 and the cost per message is $0.20 (Line 2- 3).

Next, apply the formula m * COST_PER_MIN + tx * COST_PER_MESSAGE to calculate the total bill (Line 5) and return the bill_amount as function output (Line 7).

You might be interested in
I need help with my work
Naily [24]

Answer:

totally

awesome

Explanation:

You can evaluate the expressions in the statements by hand:

if (a*b!=c) evaluates to

if (2*3 != 11)

if (6 != 11)

if (true)

so the next line is executed (it prints 'totally')

Likewise, the other if statement also evaluates to true.

4 0
2 years ago
The economic importance of computer viruses​
Lena [83]

Answer:

whats the question?

Explanation:

3 0
2 years ago
Read 2 more answers
Complete the statement using the correct term.
eduard

Answer:

Pixels

Explanation:

3 0
3 years ago
Write a Python program to solve the problem described above. Define a function satisfactory_meal(Meal) which takes a single para
kompoz [17]

def dx(fn, x, delta=0.001):

   return (fn(x+delta) - fn(x))/delta

def solve(fn, value, x=0.5, maxtries=1000, maxerr=0.00001):

   for tries in xrange(maxtries):

       err = fn(x) - value

       if abs(err) < maxerr:

           return x

       slope = dx(fn, x)

       x -= err/slope

   raise ValueError('no solution found')

3 0
2 years ago
What’s your fave tv show?
kompoz [17]

Answer:

the vampire diareas

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Plz answer and dont put a random thing for the points
    11·1 answer
  • Laura has identified the job she wants, the skills needed for the position, and the areas she needs to improve in order to get i
    10·1 answer
  • Chdtp aoxophg gr72 ae9&gt;3 zqqz
    12·1 answer
  • In this exercise, you are given a phrase and need to return that phrase in all capital letters.
    6·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • An investor is considering in which of two start-up companies to invest. The investor has faith in the industrial organization (
    9·2 answers
  • What lets you do many things, like write book reports and stories?
    15·1 answer
  • Suppose that we want to multiply 500 matrices and we use the optimal parenthesization computed by the MATRIX-CHAIN-ORDER functio
    13·2 answers
  • What is the answer 11100+01010​
    8·1 answer
  • 3s X 82 = X +y? is this true
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!