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
VLD [36.1K]
3 years ago
13

Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.For example, if the user ent

ers 10 for subtotal and 15% for gratuity rate,the program displays $1.5 as gratuity and $11.5 as total.Sample RunEnter the subtotal and a gratuity rate: 10 15The gratuity is $1.5 and total is $11.5Class Name: Exercise02_05
Computers and Technology
1 answer:
lubasha [3.4K]3 years ago
8 0

Answer:

Using Javascript,

function calTotal( subtotal, gratuity){

  gratuityValue = subtotal * (gratuity/100)

  total = subtotal + gratuityValue

  console.log( "gratuity: ", gratuityValue , "\nTotal: ", total)

}

Explanation:

The javascript function above is able to collect two parameters subtotal and gratuity rate in percentage and calculate the total and gratuity value, and displays it on the console.

You might be interested in
true or false manual handling of materials accounts for the primary source of energy in the workplace
Rus_ich [418]
True, hope this helps
6 0
3 years ago
Read 2 more answers
What is wrong with my code...
stiv31 [10]
I'm not sure of the problem that you had in the first place, but I can point out that in your "bigger" method, if a number is greater than one then it is bigger, however the else statement says that the number *can* also be equal[==] to the second argument, so for example bigger(1,1) it would check if 1 > 1 and return false, so it will return that b[the second 1] is bigger! Hope this helps :D
3 0
4 years ago
Which of the following shows a list of Big-Oh running times in order from slowest to fastest?
Rufina [12.5K]

Answer:

O(N!), O(2N), O(N2), O(N), O(logN)

Explanation:

N! grows faster than any exponential functions, leave alone polynomials and logarithm. so O( N! ) would be slowest.

2^N would be bigger than N². Any exponential functions are slower than polynomial. So O( 2^N ) is next slowest.

Rest of them should be easier.

N² is slower than N and N is slower than logN as you can check in a graphing calculator.

NOTE: It is just nitpick but big-Oh is not necessary about speed / running time ( many programmers treat it like that anyway ) but rather how the time taken for an algorithm increase as the size of the input increases. Subtle difference.

5 0
3 years ago
Read 2 more answers
Opinion on sandshrew​
Alex

Answer:Sandshrew is cute

Explanation:

3 0
3 years ago
What is the scope of each variable?
kari74 [83]

Answer:

scope of pet name is limited to pet class and color is accessible to the whole program

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Jenny is going on a trip to wildlife safari with her friends. She wants a camera that will help her shoot fast-moving animals. W
    15·2 answers
  • Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Lette
    14·1 answer
  • A vertical curve means that any change in the Aggregate Price Level will have what result?
    15·1 answer
  • Below is a 4-bit down-counter. What is the largest number of the counter if the initial state Q3Q2Q1Q0=0011? (D3 and Q3 are MSB,
    14·1 answer
  • How do governments correct for negative externalities?
    5·1 answer
  • When was internet started in which year​
    13·2 answers
  • Which type of file can be opened directly into Excel?
    15·1 answer
  • Consider the following code segment, which is intended to simulate a random process. The code is intended to set the value of th
    13·1 answer
  • You have a technical interview for a new position in digital media. One of the questions you are asked is this: “A client asks y
    13·1 answer
  • Data frames can be subset by a chosen value using ==.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!