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
svet-max [94.6K]
3 years ago
11

Write a function numberofpennies() that returns the total number of pennies given a number of dollars and (optionally) a number

of pennies. ex: 5 dollars and 6 pennies returns 506.
Mathematics
1 answer:
ElenaW [278]3 years ago
5 0
What language are you writing this in? C? Javascript? Java? Are you allow to have parameters? 
The general idea should be the same. Since 1 dollar  = 100 pennies, we should write something like...

Java:
public static double numberofpennies(double dollars, double penny) {         
           double sum = 0;                  

           // The amount of pennies that dollar represents       
           double converted = dollars * 100.0;                  

           sum = converted + penny;
         
           return sum;   
}
Note: You should probably place this question under the category computer and technology instead of math. Also, this is just an example of what you could possibly write. What parameters you are allowed to use, what type (double? int? etc?) of pennies are you allowed to return, etc. depends on how you write it. 



You might be interested in
What is the value of y in this triangle?<br><br> A ) 124°<br> B ) 98°<br> C ) 56°<br> D ) 36°
Zolol [24]
180-134=46 98+46=144. 180-144=36. angle y=36. So the answer is D)36.
5 0
4 years ago
Read 2 more answers
ostricher teacher plans to arrange the students in equal roles only girls are boys will be in each row if there are 44 girls and
uranmaximum [27]

Answer:

Step-by-step explanation:

4 0
2 years ago
0.5w+3x, when w=6, v=5
Lina20 [59]

Answer:

18

Step-by-step explanation:

6 0
3 years ago
F(x)=x^2 what is g(x)?<br><br> pls help me
Lady bird [3.3K]
G(x) = ax^2
y = ax^2
5 = a(1)^2
a = 5
Therefore, g(x) = 5x^2
8 0
3 years ago
Does 10 7 11 make a triangle
Irina-Kira [14]

Answer:

yes

Step-by-step explanation:

For the given sides to make a triangle.

The sum of any 2 sides must be greater than the third side

10 + 7 = 17 > 11

10 + 11 = 21 > 7

7 + 11 = 18 > 10

Thus the sides 10, 7, 11 will make a triangle

7 0
3 years ago
Other questions:
  • Find the amount accumulated after investing a principle P for T years at an interest rate compounded k times per year.
    13·1 answer
  • Need help with number 8
    6·1 answer
  • I need the answer with the work
    9·1 answer
  • GIVING OUT 5 POINTS JUST ANWSER THIS QUESTION 2+6 TIMES 3000001 DIVIDED BY 23 AND SUBTRACT 2 AND ADD 1
    14·1 answer
  • Gradient and y intercept coordinates of x=6+2y
    6·1 answer
  • Megan makes $480 a week and her boss wanted to give her
    11·1 answer
  • What is the volume, in cubic centimeters, of a rectangular prism with a height of 8 centimeters, a width of 7 centimeters, and a
    13·2 answers
  • Step 1: 12x – 15 – 12x = 7x + 20
    5·1 answer
  • Freeeeeeeeeee points I hope your get some
    8·2 answers
  • Please helppp me anyone​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!