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
____ [38]
3 years ago
7

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.
Sample program:
#include
using namespace std;

int main() {
cout << NumberOfPennies(5, 6) << endl; // Should print 506
cout << NumberOfPennies(4) << endl; // Should print 400
return 0;
Computers and Technology
1 answer:
Over [174]3 years ago
4 0

Answer:

Following are the code to the given question:

#include <iostream>//header file  

using namespace std;

int NumberOfPennies(int ND, int NP=0)//defining a method that accepts two parameters  

{

return (ND*100 +NP);//use return keyword that fist multiply by 100 then add the value  

}

int main() //main method

{

cout << NumberOfPennies(5,6) << endl; // Should print 506

cout << NumberOfPennies(4) << endl; // Should print 400

return 0;

}

Output:

506

400

Explanation:

In the method "NumberOfPennies" it accepts two parameters that are "ND and NP" that uses the return keyword that multiply 100 in ND variable and add in NP variable and return its values.

In the main method it it uses the cout method that call the by accepts value in parameter and print its value.

You might be interested in
A personal career profile for can be used to match what you know about yourself to what you know about different careers
mel-nik [20]

Answer:

B

Explanation:

give answers next time pls so i can help you!!

3 0
4 years ago
Read 2 more answers
Advantages of e commerce
Sloan [31]

Answer:

A Larger Market

Customer Insights Through Tracking And Analytics

Fast Response To Consumer Trends And Market Demand

Lower Cost

More Opportunities To "Sell"

Personalized Messaging

Hope this helps!

4 0
4 years ago
Most search engines provide specific pages on which you can search for____ and
vazorg [7]

Answer: c

Explanation: a

7 0
3 years ago
Read 2 more answers
Which Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit origina
Vera_Pavlovna [14]

Answer:

Creative Commons license type allows others to use and build upon work non-commercially, provided that they credit original author and maintain the same licensing is described below in detail.

Explanation:

Attribution-Non financially-ShareAlike

This permission lets others adapt, remix, and develop upon your work non-financially, as long as they charge you and license their new inventions under identical times. There are six separate license classes, scheduled from most to least licensed. the material in any mechanism or arrangement, so long as attribution is given to the originator.

8 0
3 years ago
Which action should be done throughout the mail merge process
Wittaler [7]
C. Save and proof answe for apex. ;)

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following would you click to access Help and Support?
    6·2 answers
  • Which of these molecules has the same number of shared and unshared electron pairs?CCl2F2Br2HClPF3H2S
    9·2 answers
  • Write the equivalent c++ expression for the following algebraic expressions
    11·1 answer
  • How would you display all your photographic work in your résumé, if you have a large volume of work?
    10·1 answer
  • In a 4-way 16-bit Multiplexor the selector is:________
    6·1 answer
  • Which of the following is similar to defense in depth and supports multiple layers of security?a. Defense in depthb. Diversity o
    7·1 answer
  • Why do most employers encourage their workers to invest in 401(k) accounts? (Site 1)
    14·2 answers
  • When using the Simple Query Wizard, Kirsten wanted to transfer all of her available data to a new table. She should click
    14·1 answer
  • When you use the .net data provider objects to retrieve data from a database, you can store the data in an object called a?
    8·1 answer
  • Ava is at her first job interview, and the interviewer asks her a difficult question she hasn't prepared to answer. What should
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!